#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const WLAN_MAC_MAX_RATES: u32 = 263;
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WlanRxInfoFlags: u32 {
const FCS_INVALID = 1;
const FRAME_BODY_PADDING_4 = 2;
}
}
impl WlanRxInfoFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u32) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WlanRxInfoValid: u32 {
const PHY = 1;
const DATA_RATE = 2;
const CHAN_WIDTH = 4;
const MCS = 8;
const RSSI = 16;
const SNR = 32;
}
}
impl WlanRxInfoValid {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u32) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WlanTxInfoFlags: u32 {
const PROTECTED = 1;
const FAVOR_RELIABILITY = 2;
const QOS = 4;
}
}
impl WlanTxInfoFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u32) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WlanTxInfoValid: u32 {
const DATA_RATE = 1;
const TX_VECTOR_IDX = 2;
const PHY = 4;
const CHANNEL_BANDWIDTH = 8;
const MCS = 16;
}
}
impl WlanTxInfoValid {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u32) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
self.bits() & !Self::all().bits()
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum WlanProtection {
None = 0,
Rx = 1,
Tx = 2,
RxTx = 3,
}
impl WlanProtection {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::None),
1 => Some(Self::Rx),
2 => Some(Self::Tx),
3 => Some(Self::RxTx),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanRxInfo {
pub rx_flags: WlanRxInfoFlags,
pub valid_fields: WlanRxInfoValid,
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, Debug, PartialEq)]
pub struct WlanRxPacket {
pub mac_frame: Vec<u8>,
pub info: WlanRxInfo,
}
impl fidl::Persistable for WlanRxPacket {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanSoftmacBaseJoinBssRequest {
pub join_request: fidl_fuchsia_wlan_common::JoinBssRequest,
}
impl fidl::Persistable for WlanSoftmacBaseJoinBssRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanSoftmacBaseNotifyAssociationCompleteRequest {
pub assoc_cfg: WlanAssociationConfig,
}
impl fidl::Persistable for WlanSoftmacBaseNotifyAssociationCompleteRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanSoftmacBaseQueryDiscoverySupportResponse {
pub resp: fidl_fuchsia_wlan_common::DiscoverySupport,
}
impl fidl::Persistable for WlanSoftmacBaseQueryDiscoverySupportResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanSoftmacBaseQueryMacSublayerSupportResponse {
pub resp: fidl_fuchsia_wlan_common::MacSublayerSupport,
}
impl fidl::Persistable for WlanSoftmacBaseQueryMacSublayerSupportResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanSoftmacBaseQuerySecuritySupportResponse {
pub resp: fidl_fuchsia_wlan_common::SecuritySupport,
}
impl fidl::Persistable for WlanSoftmacBaseQuerySecuritySupportResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
pub resp: fidl_fuchsia_wlan_common::SpectrumManagementSupport,
}
impl fidl::Persistable for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct WlanSoftmacBridgeSetEthernetStatusRequest {
pub status: u32,
}
impl fidl::Persistable for WlanSoftmacBridgeSetEthernetStatusRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WlanSoftmacBridgeStartRequest {
pub ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
pub ethernet_tx: u64,
pub wlan_rx: u64,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for WlanSoftmacBridgeStartRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WlanSoftmacBridgeStartResponse {
pub sme_channel: fidl::Channel,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for WlanSoftmacBridgeStartResponse
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanSoftmacIfcBaseReportTxResultRequest {
pub tx_result: fidl_fuchsia_wlan_common::WlanTxResult,
}
impl fidl::Persistable for WlanSoftmacIfcBaseReportTxResultRequest {}
#[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 channel_bandwidth: fidl_fuchsia_wlan_common::ChannelBandwidth,
pub mcs: u8,
}
impl fidl::Persistable for WlanTxInfo {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WlanTxPacket {
pub mac_frame: Vec<u8>,
pub info: WlanTxInfo,
}
impl fidl::Persistable for WlanTxPacket {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct EthernetRxTransferRequest {
pub packet_address: Option<u64>,
pub packet_size: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for EthernetRxTransferRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct EthernetTxTransferRequest {
pub packet_address: Option<u64>,
pub packet_size: Option<u64>,
pub async_id: Option<u64>,
pub borrowed_operation: Option<u64>,
pub complete_borrowed_operation: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for EthernetTxTransferRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanAssociationConfig {
pub bssid: Option<[u8; 6]>,
pub aid: Option<u16>,
pub listen_interval: Option<u16>,
pub channel: Option<fidl_fuchsia_wlan_common::WlanChannel>,
pub qos: Option<bool>,
pub wmm_params: Option<fidl_fuchsia_wlan_common::WlanWmmParameters>,
pub rates: Option<Vec<u8>>,
pub capability_info: Option<u16>,
pub ht_cap: Option<fidl_fuchsia_wlan_ieee80211::HtCapabilities>,
pub ht_op: Option<fidl_fuchsia_wlan_ieee80211::HtOperation>,
pub vht_cap: Option<fidl_fuchsia_wlan_ieee80211::VhtCapabilities>,
pub vht_op: Option<fidl_fuchsia_wlan_ieee80211::VhtOperation>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanAssociationConfig {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanKeyConfiguration {
pub protection: Option<WlanProtection>,
pub cipher_oui: Option<[u8; 3]>,
pub cipher_type: Option<u8>,
pub key_type: Option<fidl_fuchsia_wlan_common::WlanKeyType>,
pub peer_addr: Option<[u8; 6]>,
pub key_idx: Option<u8>,
pub key: Option<Vec<u8>>,
pub rsc: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanKeyConfiguration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanRxTransferRequest {
pub packet_address: Option<u64>,
pub packet_size: Option<u64>,
pub packet_info: Option<WlanRxInfo>,
pub async_id: Option<u64>,
pub arena: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanRxTransferRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBandCapability {
pub band: Option<fidl_fuchsia_wlan_ieee80211::WlanBand>,
pub basic_rate_count: Option<u8>,
pub basic_rate_list: Option<[u8; 12]>,
pub ht_supported: Option<bool>,
pub ht_caps: Option<fidl_fuchsia_wlan_ieee80211::HtCapabilities>,
pub vht_supported: Option<bool>,
pub vht_caps: Option<fidl_fuchsia_wlan_ieee80211::VhtCapabilities>,
pub operating_channel_count: Option<u16>,
pub operating_channel_list: Option<[u8; 256]>,
pub basic_rates: Option<Vec<u8>>,
pub operating_channels: Option<Vec<u8>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBandCapability {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBaseCancelScanRequest {
pub scan_id: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBaseCancelScanRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBaseClearAssociationRequest {
pub peer_addr: Option<[u8; 6]>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBaseClearAssociationRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBaseEnableBeaconingRequest {
pub packet_template: Option<WlanTxPacket>,
pub tim_ele_offset: Option<u64>,
pub beacon_interval: Option<u16>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBaseEnableBeaconingRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBaseSetChannelRequest {
pub channel: Option<fidl_fuchsia_wlan_common::WlanChannel>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBaseSetChannelRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBaseStartPassiveScanRequest {
pub channels: Option<Vec<u8>>,
pub min_channel_time: Option<i64>,
pub max_channel_time: Option<i64>,
pub min_home_time: Option<i64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBaseUpdateWmmParametersRequest {
pub ac: Option<fidl_fuchsia_wlan_ieee80211::WlanAccessCategory>,
pub params: Option<fidl_fuchsia_wlan_common::WlanWmmParameters>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBaseUpdateWmmParametersRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBaseStartActiveScanResponse {
pub scan_id: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBaseStartActiveScanResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacBaseStartPassiveScanResponse {
pub scan_id: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacIfcBaseNotifyScanCompleteRequest {
pub status: Option<i32>,
pub scan_id: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacIfcBaseNotifyScanCompleteRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacQueryResponse {
pub sta_addr: Option<[u8; 6]>,
pub mac_role: Option<fidl_fuchsia_wlan_common::WlanMacRole>,
pub supported_phys: Option<Vec<fidl_fuchsia_wlan_common::WlanPhyType>>,
pub hardware_capability: Option<u32>,
pub band_caps: Option<Vec<WlanSoftmacBandCapability>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacQueryResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanSoftmacStartActiveScanRequest {
pub channels: Option<Vec<u8>>,
pub ssids: Option<Vec<fidl_fuchsia_wlan_ieee80211::CSsid>>,
pub mac_header: Option<Vec<u8>>,
pub ies: Option<Vec<u8>>,
pub min_channel_time: Option<i64>,
pub max_channel_time: Option<i64>,
pub min_home_time: Option<i64>,
pub min_probes_per_channel: Option<u8>,
pub max_probes_per_channel: Option<u8>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanSoftmacStartActiveScanRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct WlanTxTransferRequest {
pub packet_address: Option<u64>,
pub packet_size: Option<u64>,
pub packet_info: Option<WlanTxInfo>,
pub async_id: Option<u64>,
pub arena: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for WlanTxTransferRequest {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct EthernetRxMarker;
impl fidl::endpoints::ProtocolMarker for EthernetRxMarker {
type Proxy = EthernetRxProxy;
type RequestStream = EthernetRxRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = EthernetRxSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) EthernetRx";
}
pub type EthernetRxTransferResult = Result<(), i32>;
pub trait EthernetRxProxyInterface: Send + Sync {
type TransferResponseFut: std::future::Future<Output = Result<EthernetRxTransferResult, fidl::Error>>
+ Send;
fn r#transfer(&self, payload: &EthernetRxTransferRequest) -> Self::TransferResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct EthernetRxSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for EthernetRxSynchronousProxy {
type Proxy = EthernetRxProxy;
type Protocol = EthernetRxMarker;
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 EthernetRxSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <EthernetRxMarker 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<EthernetRxEvent, fidl::Error> {
EthernetRxEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#transfer(
&self,
mut payload: &EthernetRxTransferRequest,
___deadline: zx::MonotonicInstant,
) -> Result<EthernetRxTransferResult, fidl::Error> {
let _response = self.client.send_query::<
EthernetRxTransferRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x199ff3498ef8a22a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct EthernetRxProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for EthernetRxProxy {
type Protocol = EthernetRxMarker;
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 EthernetRxProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> EthernetRxEventStream {
EthernetRxEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#transfer(
&self,
mut payload: &EthernetRxTransferRequest,
) -> fidl::client::QueryResponseFut<
EthernetRxTransferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
EthernetRxProxyInterface::r#transfer(self, payload)
}
}
impl EthernetRxProxyInterface for EthernetRxProxy {
type TransferResponseFut = fidl::client::QueryResponseFut<
EthernetRxTransferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#transfer(&self, mut payload: &EthernetRxTransferRequest) -> Self::TransferResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<EthernetRxTransferResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x199ff3498ef8a22a,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<EthernetRxTransferRequest, EthernetRxTransferResult>(
payload,
0x199ff3498ef8a22a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct EthernetRxEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for EthernetRxEventStream {}
impl futures::stream::FusedStream for EthernetRxEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for EthernetRxEventStream {
type Item = Result<EthernetRxEvent, 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(EthernetRxEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum EthernetRxEvent {}
impl EthernetRxEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<EthernetRxEvent, 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: <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct EthernetRxRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for EthernetRxRequestStream {}
impl futures::stream::FusedStream for EthernetRxRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for EthernetRxRequestStream {
type Protocol = EthernetRxMarker;
type ControlHandle = EthernetRxControlHandle;
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 {
EthernetRxControlHandle { 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 EthernetRxRequestStream {
type Item = Result<EthernetRxRequest, 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 EthernetRxRequestStream 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 {
0x199ff3498ef8a22a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
EthernetRxTransferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EthernetRxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = EthernetRxControlHandle { inner: this.inner.clone() };
Ok(EthernetRxRequest::Transfer {
payload: req,
responder: EthernetRxTransferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum EthernetRxRequest {
Transfer { payload: EthernetRxTransferRequest, responder: EthernetRxTransferResponder },
}
impl EthernetRxRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_transfer(self) -> Option<(EthernetRxTransferRequest, EthernetRxTransferResponder)> {
if let EthernetRxRequest::Transfer { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
EthernetRxRequest::Transfer { .. } => "transfer",
}
}
}
#[derive(Debug, Clone)]
pub struct EthernetRxControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for EthernetRxControlHandle {
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 EthernetRxControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct EthernetRxTransferResponder {
control_handle: std::mem::ManuallyDrop<EthernetRxControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for EthernetRxTransferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for EthernetRxTransferResponder {
type ControlHandle = EthernetRxControlHandle;
fn control_handle(&self) -> &EthernetRxControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl EthernetRxTransferResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x199ff3498ef8a22a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct EthernetTxMarker;
impl fidl::endpoints::ProtocolMarker for EthernetTxMarker {
type Proxy = EthernetTxProxy;
type RequestStream = EthernetTxRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = EthernetTxSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) EthernetTx";
}
pub type EthernetTxTransferResult = Result<(), i32>;
pub trait EthernetTxProxyInterface: Send + Sync {
type TransferResponseFut: std::future::Future<Output = Result<EthernetTxTransferResult, fidl::Error>>
+ Send;
fn r#transfer(&self, payload: &EthernetTxTransferRequest) -> Self::TransferResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct EthernetTxSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for EthernetTxSynchronousProxy {
type Proxy = EthernetTxProxy;
type Protocol = EthernetTxMarker;
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 EthernetTxSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <EthernetTxMarker 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<EthernetTxEvent, fidl::Error> {
EthernetTxEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#transfer(
&self,
mut payload: &EthernetTxTransferRequest,
___deadline: zx::MonotonicInstant,
) -> Result<EthernetTxTransferResult, fidl::Error> {
let _response = self.client.send_query::<
EthernetTxTransferRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x616dafedf07d00e7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct EthernetTxProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for EthernetTxProxy {
type Protocol = EthernetTxMarker;
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 EthernetTxProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> EthernetTxEventStream {
EthernetTxEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#transfer(
&self,
mut payload: &EthernetTxTransferRequest,
) -> fidl::client::QueryResponseFut<
EthernetTxTransferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
EthernetTxProxyInterface::r#transfer(self, payload)
}
}
impl EthernetTxProxyInterface for EthernetTxProxy {
type TransferResponseFut = fidl::client::QueryResponseFut<
EthernetTxTransferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#transfer(&self, mut payload: &EthernetTxTransferRequest) -> Self::TransferResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<EthernetTxTransferResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x616dafedf07d00e7,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<EthernetTxTransferRequest, EthernetTxTransferResult>(
payload,
0x616dafedf07d00e7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct EthernetTxEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for EthernetTxEventStream {}
impl futures::stream::FusedStream for EthernetTxEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for EthernetTxEventStream {
type Item = Result<EthernetTxEvent, 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(EthernetTxEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum EthernetTxEvent {}
impl EthernetTxEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<EthernetTxEvent, 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: <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct EthernetTxRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for EthernetTxRequestStream {}
impl futures::stream::FusedStream for EthernetTxRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for EthernetTxRequestStream {
type Protocol = EthernetTxMarker;
type ControlHandle = EthernetTxControlHandle;
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 {
EthernetTxControlHandle { 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 EthernetTxRequestStream {
type Item = Result<EthernetTxRequest, 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 EthernetTxRequestStream 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 {
0x616dafedf07d00e7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
EthernetTxTransferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EthernetTxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = EthernetTxControlHandle { inner: this.inner.clone() };
Ok(EthernetTxRequest::Transfer {
payload: req,
responder: EthernetTxTransferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum EthernetTxRequest {
Transfer { payload: EthernetTxTransferRequest, responder: EthernetTxTransferResponder },
}
impl EthernetTxRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_transfer(self) -> Option<(EthernetTxTransferRequest, EthernetTxTransferResponder)> {
if let EthernetTxRequest::Transfer { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
EthernetTxRequest::Transfer { .. } => "transfer",
}
}
}
#[derive(Debug, Clone)]
pub struct EthernetTxControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for EthernetTxControlHandle {
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 EthernetTxControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct EthernetTxTransferResponder {
control_handle: std::mem::ManuallyDrop<EthernetTxControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for EthernetTxTransferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for EthernetTxTransferResponder {
type ControlHandle = EthernetTxControlHandle;
fn control_handle(&self) -> &EthernetTxControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl EthernetTxTransferResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x616dafedf07d00e7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WlanRxMarker;
impl fidl::endpoints::ProtocolMarker for WlanRxMarker {
type Proxy = WlanRxProxy;
type RequestStream = WlanRxRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WlanRxSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) WlanRx";
}
pub trait WlanRxProxyInterface: Send + Sync {
type TransferResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#transfer(&self, payload: &WlanRxTransferRequest) -> Self::TransferResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WlanRxSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WlanRxSynchronousProxy {
type Proxy = WlanRxProxy;
type Protocol = WlanRxMarker;
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 WlanRxSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <WlanRxMarker 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<WlanRxEvent, fidl::Error> {
WlanRxEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#transfer(
&self,
mut payload: &WlanRxTransferRequest,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<WlanRxTransferRequest, fidl::encoding::EmptyPayload>(
payload,
0x2c73b18cbfca6055,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct WlanRxProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WlanRxProxy {
type Protocol = WlanRxMarker;
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 WlanRxProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WlanRxEventStream {
WlanRxEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#transfer(
&self,
mut payload: &WlanRxTransferRequest,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
WlanRxProxyInterface::r#transfer(self, payload)
}
}
impl WlanRxProxyInterface for WlanRxProxy {
type TransferResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#transfer(&self, mut payload: &WlanRxTransferRequest) -> Self::TransferResponseFut {
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,
0x2c73b18cbfca6055,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<WlanRxTransferRequest, ()>(
payload,
0x2c73b18cbfca6055,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WlanRxEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WlanRxEventStream {}
impl futures::stream::FusedStream for WlanRxEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WlanRxEventStream {
type Item = Result<WlanRxEvent, 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(WlanRxEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WlanRxEvent {}
impl WlanRxEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WlanRxEvent, 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: <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WlanRxRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WlanRxRequestStream {}
impl futures::stream::FusedStream for WlanRxRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WlanRxRequestStream {
type Protocol = WlanRxMarker;
type ControlHandle = WlanRxControlHandle;
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 {
WlanRxControlHandle { 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 WlanRxRequestStream {
type Item = Result<WlanRxRequest, 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 WlanRxRequestStream 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 {
0x2c73b18cbfca6055 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanRxTransferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanRxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlanRxControlHandle { inner: this.inner.clone() };
Ok(WlanRxRequest::Transfer {
payload: req,
responder: WlanRxTransferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WlanRxRequest {
Transfer { payload: WlanRxTransferRequest, responder: WlanRxTransferResponder },
}
impl WlanRxRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_transfer(self) -> Option<(WlanRxTransferRequest, WlanRxTransferResponder)> {
if let WlanRxRequest::Transfer { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WlanRxRequest::Transfer { .. } => "transfer",
}
}
}
#[derive(Debug, Clone)]
pub struct WlanRxControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WlanRxControlHandle {
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 WlanRxControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanRxTransferResponder {
control_handle: std::mem::ManuallyDrop<WlanRxControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanRxTransferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanRxTransferResponder {
type ControlHandle = WlanRxControlHandle;
fn control_handle(&self) -> &WlanRxControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanRxTransferResponder {
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,
0x2c73b18cbfca6055,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WlanSoftmacBaseMarker;
impl fidl::endpoints::ProtocolMarker for WlanSoftmacBaseMarker {
type Proxy = WlanSoftmacBaseProxy;
type RequestStream = WlanSoftmacBaseRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WlanSoftmacBaseSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacBase";
}
pub type WlanSoftmacBaseQueryResult = Result<WlanSoftmacQueryResponse, i32>;
pub type WlanSoftmacBaseQueryDiscoverySupportResult =
Result<fidl_fuchsia_wlan_common::DiscoverySupport, i32>;
pub type WlanSoftmacBaseQueryMacSublayerSupportResult =
Result<fidl_fuchsia_wlan_common::MacSublayerSupport, i32>;
pub type WlanSoftmacBaseQuerySecuritySupportResult =
Result<fidl_fuchsia_wlan_common::SecuritySupport, i32>;
pub type WlanSoftmacBaseQuerySpectrumManagementSupportResult =
Result<fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>;
pub type WlanSoftmacBaseSetChannelResult = Result<(), i32>;
pub type WlanSoftmacBaseJoinBssResult = Result<(), i32>;
pub type WlanSoftmacBaseEnableBeaconingResult = Result<(), i32>;
pub type WlanSoftmacBaseDisableBeaconingResult = Result<(), i32>;
pub type WlanSoftmacBaseInstallKeyResult = Result<(), i32>;
pub type WlanSoftmacBaseNotifyAssociationCompleteResult = Result<(), i32>;
pub type WlanSoftmacBaseClearAssociationResult = Result<(), i32>;
pub type WlanSoftmacBaseStartPassiveScanResult =
Result<WlanSoftmacBaseStartPassiveScanResponse, i32>;
pub type WlanSoftmacBaseStartActiveScanResult = Result<WlanSoftmacBaseStartActiveScanResponse, i32>;
pub type WlanSoftmacBaseCancelScanResult = Result<(), i32>;
pub type WlanSoftmacBaseUpdateWmmParametersResult = Result<(), i32>;
pub trait WlanSoftmacBaseProxyInterface: Send + Sync {
type QueryResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQueryResult, fidl::Error>>
+ Send;
fn r#query(&self) -> Self::QueryResponseFut;
type QueryDiscoverySupportResponseFut: std::future::Future<
Output = Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error>,
> + Send;
fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut;
type QueryMacSublayerSupportResponseFut: std::future::Future<
Output = Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error>,
> + Send;
fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut;
type QuerySecuritySupportResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error>>
+ Send;
fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut;
type QuerySpectrumManagementSupportResponseFut: std::future::Future<
Output = Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error>,
> + Send;
fn r#query_spectrum_management_support(
&self,
) -> Self::QuerySpectrumManagementSupportResponseFut;
type SetChannelResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseSetChannelResult, fidl::Error>>
+ Send;
fn r#set_channel(
&self,
payload: &WlanSoftmacBaseSetChannelRequest,
) -> Self::SetChannelResponseFut;
type JoinBssResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseJoinBssResult, fidl::Error>>
+ Send;
fn r#join_bss(
&self,
join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
) -> Self::JoinBssResponseFut;
type EnableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error>>
+ Send;
fn r#enable_beaconing(
&self,
payload: &WlanSoftmacBaseEnableBeaconingRequest,
) -> Self::EnableBeaconingResponseFut;
type DisableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error>>
+ Send;
fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut;
type InstallKeyResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseInstallKeyResult, fidl::Error>>
+ Send;
fn r#install_key(&self, payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut;
type NotifyAssociationCompleteResponseFut: std::future::Future<
Output = Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error>,
> + Send;
fn r#notify_association_complete(
&self,
assoc_cfg: &WlanAssociationConfig,
) -> Self::NotifyAssociationCompleteResponseFut;
type ClearAssociationResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseClearAssociationResult, fidl::Error>>
+ Send;
fn r#clear_association(
&self,
payload: &WlanSoftmacBaseClearAssociationRequest,
) -> Self::ClearAssociationResponseFut;
type StartPassiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error>>
+ Send;
fn r#start_passive_scan(
&self,
payload: &WlanSoftmacBaseStartPassiveScanRequest,
) -> Self::StartPassiveScanResponseFut;
type StartActiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error>>
+ Send;
fn r#start_active_scan(
&self,
payload: &WlanSoftmacStartActiveScanRequest,
) -> Self::StartActiveScanResponseFut;
type CancelScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseCancelScanResult, fidl::Error>>
+ Send;
fn r#cancel_scan(
&self,
payload: &WlanSoftmacBaseCancelScanRequest,
) -> Self::CancelScanResponseFut;
type UpdateWmmParametersResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error>>
+ Send;
fn r#update_wmm_parameters(
&self,
payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
) -> Self::UpdateWmmParametersResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WlanSoftmacBaseSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WlanSoftmacBaseSynchronousProxy {
type Proxy = WlanSoftmacBaseProxy;
type Protocol = WlanSoftmacBaseMarker;
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 WlanSoftmacBaseSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <WlanSoftmacBaseMarker 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<WlanSoftmacBaseEvent, fidl::Error> {
WlanSoftmacBaseEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#query(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
>(
(),
0x18231a638e508f9d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query_discovery_support(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
WlanSoftmacBaseQueryDiscoverySupportResponse,
i32,
>>(
(),
0x16797affc0cb58ae,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#query_mac_sublayer_support(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
WlanSoftmacBaseQueryMacSublayerSupportResponse,
i32,
>>(
(),
0x7302c3f8c131f075,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#query_security_support(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
WlanSoftmacBaseQuerySecuritySupportResponse,
i32,
>>(
(),
0x3691bb75abf6354,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#query_spectrum_management_support(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
i32,
>>(
(), 0x347d78dc1d4d27bf, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#set_channel(
&self,
mut payload: &WlanSoftmacBaseSetChannelRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseSetChannelRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x12836b533cd63ece,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#join_bss(
&self,
mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseJoinBssRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(join_request,),
0x1336fb5455b77a6e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#enable_beaconing(
&self,
mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseEnableBeaconingRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x6c35807632c64576,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#disable_beaconing(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x3303b30f99dbb406,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#install_key(
&self,
mut payload: &WlanKeyConfiguration,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
let _response = self.client.send_query::<
WlanKeyConfiguration,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x7decf9b4200b9131,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#notify_association_complete(
&self,
mut assoc_cfg: &WlanAssociationConfig,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseNotifyAssociationCompleteRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(assoc_cfg,),
0x436ffe3ba461d6cd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#clear_association(
&self,
mut payload: &WlanSoftmacBaseClearAssociationRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseClearAssociationRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x581d76c39190a7dd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#start_passive_scan(
&self,
mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseStartPassiveScanRequest,
fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
>(
payload,
0x5662f989cb4083bb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#start_active_scan(
&self,
mut payload: &WlanSoftmacStartActiveScanRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacStartActiveScanRequest,
fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
>(
payload,
0x4896eafa9937751e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#cancel_scan(
&self,
mut payload: &WlanSoftmacBaseCancelScanRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseCancelScanRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0xf7d859369764556,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#update_wmm_parameters(
&self,
mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseUpdateWmmParametersRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x68522c7122d5f78c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct WlanSoftmacBaseProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WlanSoftmacBaseProxy {
type Protocol = WlanSoftmacBaseMarker;
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 WlanSoftmacBaseProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WlanSoftmacBaseEventStream {
WlanSoftmacBaseEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#query(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#query(self)
}
pub fn r#query_discovery_support(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryDiscoverySupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#query_discovery_support(self)
}
pub fn r#query_mac_sublayer_support(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryMacSublayerSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#query_mac_sublayer_support(self)
}
pub fn r#query_security_support(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQuerySecuritySupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#query_security_support(self)
}
pub fn r#query_spectrum_management_support(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQuerySpectrumManagementSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#query_spectrum_management_support(self)
}
pub fn r#set_channel(
&self,
mut payload: &WlanSoftmacBaseSetChannelRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseSetChannelResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#set_channel(self, payload)
}
pub fn r#join_bss(
&self,
mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseJoinBssResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#join_bss(self, join_request)
}
pub fn r#enable_beaconing(
&self,
mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseEnableBeaconingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#enable_beaconing(self, payload)
}
pub fn r#disable_beaconing(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseDisableBeaconingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#disable_beaconing(self)
}
pub fn r#install_key(
&self,
mut payload: &WlanKeyConfiguration,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseInstallKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#install_key(self, payload)
}
pub fn r#notify_association_complete(
&self,
mut assoc_cfg: &WlanAssociationConfig,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseNotifyAssociationCompleteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#notify_association_complete(self, assoc_cfg)
}
pub fn r#clear_association(
&self,
mut payload: &WlanSoftmacBaseClearAssociationRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseClearAssociationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#clear_association(self, payload)
}
pub fn r#start_passive_scan(
&self,
mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseStartPassiveScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#start_passive_scan(self, payload)
}
pub fn r#start_active_scan(
&self,
mut payload: &WlanSoftmacStartActiveScanRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseStartActiveScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#start_active_scan(self, payload)
}
pub fn r#cancel_scan(
&self,
mut payload: &WlanSoftmacBaseCancelScanRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseCancelScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#cancel_scan(self, payload)
}
pub fn r#update_wmm_parameters(
&self,
mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseUpdateWmmParametersResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBaseProxyInterface::r#update_wmm_parameters(self, payload)
}
}
impl WlanSoftmacBaseProxyInterface for WlanSoftmacBaseProxy {
type QueryResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query(&self) -> Self::QueryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x18231a638e508f9d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, WlanSoftmacBaseQueryResult>(
(),
0x18231a638e508f9d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryDiscoverySupportResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryDiscoverySupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseQueryDiscoverySupportResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x16797affc0cb58ae,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseQueryDiscoverySupportResult,
>(
(),
0x16797affc0cb58ae,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryMacSublayerSupportResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryMacSublayerSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseQueryMacSublayerSupportResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7302c3f8c131f075,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseQueryMacSublayerSupportResult,
>(
(),
0x7302c3f8c131f075,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QuerySecuritySupportResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQuerySecuritySupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseQuerySecuritySupportResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3691bb75abf6354,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseQuerySecuritySupportResult,
>(
(),
0x3691bb75abf6354,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QuerySpectrumManagementSupportResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQuerySpectrumManagementSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_spectrum_management_support(
&self,
) -> Self::QuerySpectrumManagementSupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
i32,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x347d78dc1d4d27bf,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseQuerySpectrumManagementSupportResult,
>(
(),
0x347d78dc1d4d27bf,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetChannelResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseSetChannelResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_channel(
&self,
mut payload: &WlanSoftmacBaseSetChannelRequest,
) -> Self::SetChannelResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x12836b533cd63ece,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseSetChannelRequest,
WlanSoftmacBaseSetChannelResult,
>(
payload,
0x12836b533cd63ece,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type JoinBssResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseJoinBssResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#join_bss(
&self,
mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
) -> Self::JoinBssResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1336fb5455b77a6e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<WlanSoftmacBaseJoinBssRequest, WlanSoftmacBaseJoinBssResult>(
(join_request,),
0x1336fb5455b77a6e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type EnableBeaconingResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseEnableBeaconingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#enable_beaconing(
&self,
mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
) -> Self::EnableBeaconingResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6c35807632c64576,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseEnableBeaconingRequest,
WlanSoftmacBaseEnableBeaconingResult,
>(
payload,
0x6c35807632c64576,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DisableBeaconingResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseDisableBeaconingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3303b30f99dbb406,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseDisableBeaconingResult,
>(
(),
0x3303b30f99dbb406,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type InstallKeyResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseInstallKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#install_key(&self, mut payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7decf9b4200b9131,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResult>(
payload,
0x7decf9b4200b9131,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type NotifyAssociationCompleteResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseNotifyAssociationCompleteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#notify_association_complete(
&self,
mut assoc_cfg: &WlanAssociationConfig,
) -> Self::NotifyAssociationCompleteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x436ffe3ba461d6cd,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseNotifyAssociationCompleteRequest,
WlanSoftmacBaseNotifyAssociationCompleteResult,
>(
(assoc_cfg,),
0x436ffe3ba461d6cd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ClearAssociationResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseClearAssociationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#clear_association(
&self,
mut payload: &WlanSoftmacBaseClearAssociationRequest,
) -> Self::ClearAssociationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x581d76c39190a7dd,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseClearAssociationRequest,
WlanSoftmacBaseClearAssociationResult,
>(
payload,
0x581d76c39190a7dd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartPassiveScanResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseStartPassiveScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start_passive_scan(
&self,
mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
) -> Self::StartPassiveScanResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5662f989cb4083bb,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseStartPassiveScanRequest,
WlanSoftmacBaseStartPassiveScanResult,
>(
payload,
0x5662f989cb4083bb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartActiveScanResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseStartActiveScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start_active_scan(
&self,
mut payload: &WlanSoftmacStartActiveScanRequest,
) -> Self::StartActiveScanResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4896eafa9937751e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacStartActiveScanRequest,
WlanSoftmacBaseStartActiveScanResult,
>(
payload,
0x4896eafa9937751e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CancelScanResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseCancelScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#cancel_scan(
&self,
mut payload: &WlanSoftmacBaseCancelScanRequest,
) -> Self::CancelScanResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xf7d859369764556,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseCancelScanRequest,
WlanSoftmacBaseCancelScanResult,
>(
payload,
0xf7d859369764556,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UpdateWmmParametersResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseUpdateWmmParametersResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#update_wmm_parameters(
&self,
mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
) -> Self::UpdateWmmParametersResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x68522c7122d5f78c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseUpdateWmmParametersRequest,
WlanSoftmacBaseUpdateWmmParametersResult,
>(
payload,
0x68522c7122d5f78c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WlanSoftmacBaseEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WlanSoftmacBaseEventStream {}
impl futures::stream::FusedStream for WlanSoftmacBaseEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WlanSoftmacBaseEventStream {
type Item = Result<WlanSoftmacBaseEvent, 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(WlanSoftmacBaseEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WlanSoftmacBaseEvent {}
impl WlanSoftmacBaseEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WlanSoftmacBaseEvent, 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:
<WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WlanSoftmacBaseRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WlanSoftmacBaseRequestStream {}
impl futures::stream::FusedStream for WlanSoftmacBaseRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WlanSoftmacBaseRequestStream {
type Protocol = WlanSoftmacBaseMarker;
type ControlHandle = WlanSoftmacBaseControlHandle;
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 {
WlanSoftmacBaseControlHandle { 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 WlanSoftmacBaseRequestStream {
type Item = Result<WlanSoftmacBaseRequest, 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 WlanSoftmacBaseRequestStream 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 {
0x18231a638e508f9d => {
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 =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::Query {
responder: WlanSoftmacBaseQueryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x16797affc0cb58ae => {
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 =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::QueryDiscoverySupport {
responder: WlanSoftmacBaseQueryDiscoverySupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7302c3f8c131f075 => {
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 =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::QueryMacSublayerSupport {
responder: WlanSoftmacBaseQueryMacSublayerSupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3691bb75abf6354 => {
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 =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::QuerySecuritySupport {
responder: WlanSoftmacBaseQuerySecuritySupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x347d78dc1d4d27bf => {
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 =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::QuerySpectrumManagementSupport {
responder: WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x12836b533cd63ece => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseSetChannelRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseSetChannelRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::SetChannel {
payload: req,
responder: WlanSoftmacBaseSetChannelResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1336fb5455b77a6e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseJoinBssRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseJoinBssRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::JoinBss {
join_request: req.join_request,
responder: WlanSoftmacBaseJoinBssResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6c35807632c64576 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseEnableBeaconingRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseEnableBeaconingRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::EnableBeaconing {
payload: req,
responder: WlanSoftmacBaseEnableBeaconingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3303b30f99dbb406 => {
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 =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::DisableBeaconing {
responder: WlanSoftmacBaseDisableBeaconingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7decf9b4200b9131 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanKeyConfiguration,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanKeyConfiguration>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::InstallKey {
payload: req,
responder: WlanSoftmacBaseInstallKeyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x436ffe3ba461d6cd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseNotifyAssociationCompleteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::NotifyAssociationComplete {
assoc_cfg: req.assoc_cfg,
responder: WlanSoftmacBaseNotifyAssociationCompleteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x581d76c39190a7dd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseClearAssociationRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseClearAssociationRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::ClearAssociation {
payload: req,
responder: WlanSoftmacBaseClearAssociationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5662f989cb4083bb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseStartPassiveScanRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseStartPassiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::StartPassiveScan {
payload: req,
responder: WlanSoftmacBaseStartPassiveScanResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4896eafa9937751e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacStartActiveScanRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacStartActiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::StartActiveScan {
payload: req,
responder: WlanSoftmacBaseStartActiveScanResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xf7d859369764556 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseCancelScanRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseCancelScanRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::CancelScan {
payload: req,
responder: WlanSoftmacBaseCancelScanResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x68522c7122d5f78c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseUpdateWmmParametersRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseUpdateWmmParametersRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBaseRequest::UpdateWmmParameters {
payload: req,
responder: WlanSoftmacBaseUpdateWmmParametersResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WlanSoftmacBaseRequest {
Query { responder: WlanSoftmacBaseQueryResponder },
QueryDiscoverySupport { responder: WlanSoftmacBaseQueryDiscoverySupportResponder },
QueryMacSublayerSupport { responder: WlanSoftmacBaseQueryMacSublayerSupportResponder },
QuerySecuritySupport { responder: WlanSoftmacBaseQuerySecuritySupportResponder },
QuerySpectrumManagementSupport {
responder: WlanSoftmacBaseQuerySpectrumManagementSupportResponder,
},
SetChannel {
payload: WlanSoftmacBaseSetChannelRequest,
responder: WlanSoftmacBaseSetChannelResponder,
},
JoinBss {
join_request: fidl_fuchsia_wlan_common::JoinBssRequest,
responder: WlanSoftmacBaseJoinBssResponder,
},
EnableBeaconing {
payload: WlanSoftmacBaseEnableBeaconingRequest,
responder: WlanSoftmacBaseEnableBeaconingResponder,
},
DisableBeaconing { responder: WlanSoftmacBaseDisableBeaconingResponder },
InstallKey { payload: WlanKeyConfiguration, responder: WlanSoftmacBaseInstallKeyResponder },
NotifyAssociationComplete {
assoc_cfg: WlanAssociationConfig,
responder: WlanSoftmacBaseNotifyAssociationCompleteResponder,
},
ClearAssociation {
payload: WlanSoftmacBaseClearAssociationRequest,
responder: WlanSoftmacBaseClearAssociationResponder,
},
StartPassiveScan {
payload: WlanSoftmacBaseStartPassiveScanRequest,
responder: WlanSoftmacBaseStartPassiveScanResponder,
},
StartActiveScan {
payload: WlanSoftmacStartActiveScanRequest,
responder: WlanSoftmacBaseStartActiveScanResponder,
},
CancelScan {
payload: WlanSoftmacBaseCancelScanRequest,
responder: WlanSoftmacBaseCancelScanResponder,
},
UpdateWmmParameters {
payload: WlanSoftmacBaseUpdateWmmParametersRequest,
responder: WlanSoftmacBaseUpdateWmmParametersResponder,
},
}
impl WlanSoftmacBaseRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_query(self) -> Option<(WlanSoftmacBaseQueryResponder)> {
if let WlanSoftmacBaseRequest::Query { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_discovery_support(
self,
) -> Option<(WlanSoftmacBaseQueryDiscoverySupportResponder)> {
if let WlanSoftmacBaseRequest::QueryDiscoverySupport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_mac_sublayer_support(
self,
) -> Option<(WlanSoftmacBaseQueryMacSublayerSupportResponder)> {
if let WlanSoftmacBaseRequest::QueryMacSublayerSupport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_security_support(
self,
) -> Option<(WlanSoftmacBaseQuerySecuritySupportResponder)> {
if let WlanSoftmacBaseRequest::QuerySecuritySupport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_spectrum_management_support(
self,
) -> Option<(WlanSoftmacBaseQuerySpectrumManagementSupportResponder)> {
if let WlanSoftmacBaseRequest::QuerySpectrumManagementSupport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_channel(
self,
) -> Option<(WlanSoftmacBaseSetChannelRequest, WlanSoftmacBaseSetChannelResponder)> {
if let WlanSoftmacBaseRequest::SetChannel { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_join_bss(
self,
) -> Option<(fidl_fuchsia_wlan_common::JoinBssRequest, WlanSoftmacBaseJoinBssResponder)> {
if let WlanSoftmacBaseRequest::JoinBss { join_request, responder } = self {
Some((join_request, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_enable_beaconing(
self,
) -> Option<(WlanSoftmacBaseEnableBeaconingRequest, WlanSoftmacBaseEnableBeaconingResponder)>
{
if let WlanSoftmacBaseRequest::EnableBeaconing { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_disable_beaconing(self) -> Option<(WlanSoftmacBaseDisableBeaconingResponder)> {
if let WlanSoftmacBaseRequest::DisableBeaconing { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_install_key(
self,
) -> Option<(WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResponder)> {
if let WlanSoftmacBaseRequest::InstallKey { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_notify_association_complete(
self,
) -> Option<(WlanAssociationConfig, WlanSoftmacBaseNotifyAssociationCompleteResponder)> {
if let WlanSoftmacBaseRequest::NotifyAssociationComplete { assoc_cfg, responder } = self {
Some((assoc_cfg, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clear_association(
self,
) -> Option<(WlanSoftmacBaseClearAssociationRequest, WlanSoftmacBaseClearAssociationResponder)>
{
if let WlanSoftmacBaseRequest::ClearAssociation { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_passive_scan(
self,
) -> Option<(WlanSoftmacBaseStartPassiveScanRequest, WlanSoftmacBaseStartPassiveScanResponder)>
{
if let WlanSoftmacBaseRequest::StartPassiveScan { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_active_scan(
self,
) -> Option<(WlanSoftmacStartActiveScanRequest, WlanSoftmacBaseStartActiveScanResponder)> {
if let WlanSoftmacBaseRequest::StartActiveScan { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_cancel_scan(
self,
) -> Option<(WlanSoftmacBaseCancelScanRequest, WlanSoftmacBaseCancelScanResponder)> {
if let WlanSoftmacBaseRequest::CancelScan { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_update_wmm_parameters(
self,
) -> Option<(
WlanSoftmacBaseUpdateWmmParametersRequest,
WlanSoftmacBaseUpdateWmmParametersResponder,
)> {
if let WlanSoftmacBaseRequest::UpdateWmmParameters { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WlanSoftmacBaseRequest::Query { .. } => "query",
WlanSoftmacBaseRequest::QueryDiscoverySupport { .. } => "query_discovery_support",
WlanSoftmacBaseRequest::QueryMacSublayerSupport { .. } => "query_mac_sublayer_support",
WlanSoftmacBaseRequest::QuerySecuritySupport { .. } => "query_security_support",
WlanSoftmacBaseRequest::QuerySpectrumManagementSupport { .. } => {
"query_spectrum_management_support"
}
WlanSoftmacBaseRequest::SetChannel { .. } => "set_channel",
WlanSoftmacBaseRequest::JoinBss { .. } => "join_bss",
WlanSoftmacBaseRequest::EnableBeaconing { .. } => "enable_beaconing",
WlanSoftmacBaseRequest::DisableBeaconing { .. } => "disable_beaconing",
WlanSoftmacBaseRequest::InstallKey { .. } => "install_key",
WlanSoftmacBaseRequest::NotifyAssociationComplete { .. } => {
"notify_association_complete"
}
WlanSoftmacBaseRequest::ClearAssociation { .. } => "clear_association",
WlanSoftmacBaseRequest::StartPassiveScan { .. } => "start_passive_scan",
WlanSoftmacBaseRequest::StartActiveScan { .. } => "start_active_scan",
WlanSoftmacBaseRequest::CancelScan { .. } => "cancel_scan",
WlanSoftmacBaseRequest::UpdateWmmParameters { .. } => "update_wmm_parameters",
}
}
}
#[derive(Debug, Clone)]
pub struct WlanSoftmacBaseControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WlanSoftmacBaseControlHandle {
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 WlanSoftmacBaseControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseQueryResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseQueryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseQueryResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseQueryResponder {
pub fn send(
self,
mut result: Result<&WlanSoftmacQueryResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&WlanSoftmacQueryResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&WlanSoftmacQueryResponse, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>>(
result,
self.tx_id,
0x18231a638e508f9d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseQueryDiscoverySupportResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseQueryDiscoverySupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseQueryDiscoverySupportResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseQueryDiscoverySupportResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseQueryDiscoverySupportResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x16797affc0cb58ae,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseQueryMacSublayerSupportResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseQueryMacSublayerSupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseQueryMacSublayerSupportResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseQueryMacSublayerSupportResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseQueryMacSublayerSupportResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x7302c3f8c131f075,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseQuerySecuritySupportResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseQuerySecuritySupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseQuerySecuritySupportResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseQuerySecuritySupportResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseQuerySecuritySupportResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x3691bb75abf6354,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x347d78dc1d4d27bf,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseSetChannelResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseSetChannelResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseSetChannelResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseSetChannelResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x12836b533cd63ece,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseJoinBssResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseJoinBssResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseJoinBssResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseJoinBssResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x1336fb5455b77a6e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseEnableBeaconingResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseEnableBeaconingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseEnableBeaconingResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseEnableBeaconingResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x6c35807632c64576,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseDisableBeaconingResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseDisableBeaconingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseDisableBeaconingResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseDisableBeaconingResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3303b30f99dbb406,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseInstallKeyResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseInstallKeyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseInstallKeyResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseInstallKeyResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x7decf9b4200b9131,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseNotifyAssociationCompleteResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseNotifyAssociationCompleteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseNotifyAssociationCompleteResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseNotifyAssociationCompleteResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x436ffe3ba461d6cd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseClearAssociationResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseClearAssociationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseClearAssociationResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseClearAssociationResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x581d76c39190a7dd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseStartPassiveScanResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseStartPassiveScanResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseStartPassiveScanResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseStartPassiveScanResponder {
pub fn send(
self,
mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseStartPassiveScanResponse,
i32,
>>(
result,
self.tx_id,
0x5662f989cb4083bb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseStartActiveScanResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseStartActiveScanResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseStartActiveScanResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseStartActiveScanResponder {
pub fn send(
self,
mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseStartActiveScanResponse,
i32,
>>(
result,
self.tx_id,
0x4896eafa9937751e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseCancelScanResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseCancelScanResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseCancelScanResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseCancelScanResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0xf7d859369764556,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBaseUpdateWmmParametersResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBaseUpdateWmmParametersResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBaseUpdateWmmParametersResponder {
type ControlHandle = WlanSoftmacBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBaseUpdateWmmParametersResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x68522c7122d5f78c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WlanSoftmacBridgeMarker;
impl fidl::endpoints::ProtocolMarker for WlanSoftmacBridgeMarker {
type Proxy = WlanSoftmacBridgeProxy;
type RequestStream = WlanSoftmacBridgeRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WlanSoftmacBridgeSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacBridge";
}
pub type WlanSoftmacBridgeStartResult = Result<fidl::Channel, i32>;
pub trait WlanSoftmacBridgeProxyInterface: Send + Sync {
type QueryResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQueryResult, fidl::Error>>
+ Send;
fn r#query(&self) -> Self::QueryResponseFut;
type QueryDiscoverySupportResponseFut: std::future::Future<
Output = Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error>,
> + Send;
fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut;
type QueryMacSublayerSupportResponseFut: std::future::Future<
Output = Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error>,
> + Send;
fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut;
type QuerySecuritySupportResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error>>
+ Send;
fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut;
type QuerySpectrumManagementSupportResponseFut: std::future::Future<
Output = Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error>,
> + Send;
fn r#query_spectrum_management_support(
&self,
) -> Self::QuerySpectrumManagementSupportResponseFut;
type SetChannelResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseSetChannelResult, fidl::Error>>
+ Send;
fn r#set_channel(
&self,
payload: &WlanSoftmacBaseSetChannelRequest,
) -> Self::SetChannelResponseFut;
type JoinBssResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseJoinBssResult, fidl::Error>>
+ Send;
fn r#join_bss(
&self,
join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
) -> Self::JoinBssResponseFut;
type EnableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error>>
+ Send;
fn r#enable_beaconing(
&self,
payload: &WlanSoftmacBaseEnableBeaconingRequest,
) -> Self::EnableBeaconingResponseFut;
type DisableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error>>
+ Send;
fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut;
type InstallKeyResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseInstallKeyResult, fidl::Error>>
+ Send;
fn r#install_key(&self, payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut;
type NotifyAssociationCompleteResponseFut: std::future::Future<
Output = Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error>,
> + Send;
fn r#notify_association_complete(
&self,
assoc_cfg: &WlanAssociationConfig,
) -> Self::NotifyAssociationCompleteResponseFut;
type ClearAssociationResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseClearAssociationResult, fidl::Error>>
+ Send;
fn r#clear_association(
&self,
payload: &WlanSoftmacBaseClearAssociationRequest,
) -> Self::ClearAssociationResponseFut;
type StartPassiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error>>
+ Send;
fn r#start_passive_scan(
&self,
payload: &WlanSoftmacBaseStartPassiveScanRequest,
) -> Self::StartPassiveScanResponseFut;
type StartActiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error>>
+ Send;
fn r#start_active_scan(
&self,
payload: &WlanSoftmacStartActiveScanRequest,
) -> Self::StartActiveScanResponseFut;
type CancelScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseCancelScanResult, fidl::Error>>
+ Send;
fn r#cancel_scan(
&self,
payload: &WlanSoftmacBaseCancelScanRequest,
) -> Self::CancelScanResponseFut;
type UpdateWmmParametersResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error>>
+ Send;
fn r#update_wmm_parameters(
&self,
payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
) -> Self::UpdateWmmParametersResponseFut;
type StartResponseFut: std::future::Future<Output = Result<WlanSoftmacBridgeStartResult, fidl::Error>>
+ Send;
fn r#start(
&self,
ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
ethernet_tx: u64,
wlan_rx: u64,
) -> Self::StartResponseFut;
type SetEthernetStatusResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#set_ethernet_status(&self, status: u32) -> Self::SetEthernetStatusResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WlanSoftmacBridgeSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WlanSoftmacBridgeSynchronousProxy {
type Proxy = WlanSoftmacBridgeProxy;
type Protocol = WlanSoftmacBridgeMarker;
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 WlanSoftmacBridgeSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<WlanSoftmacBridgeMarker 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<WlanSoftmacBridgeEvent, fidl::Error> {
WlanSoftmacBridgeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#query(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
>(
(),
0x18231a638e508f9d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query_discovery_support(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
WlanSoftmacBaseQueryDiscoverySupportResponse,
i32,
>>(
(),
0x16797affc0cb58ae,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#query_mac_sublayer_support(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
WlanSoftmacBaseQueryMacSublayerSupportResponse,
i32,
>>(
(),
0x7302c3f8c131f075,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#query_security_support(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
WlanSoftmacBaseQuerySecuritySupportResponse,
i32,
>>(
(),
0x3691bb75abf6354,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#query_spectrum_management_support(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
i32,
>>(
(), 0x347d78dc1d4d27bf, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#set_channel(
&self,
mut payload: &WlanSoftmacBaseSetChannelRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseSetChannelRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x12836b533cd63ece,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#join_bss(
&self,
mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseJoinBssRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(join_request,),
0x1336fb5455b77a6e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#enable_beaconing(
&self,
mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseEnableBeaconingRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x6c35807632c64576,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#disable_beaconing(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x3303b30f99dbb406,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#install_key(
&self,
mut payload: &WlanKeyConfiguration,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
let _response = self.client.send_query::<
WlanKeyConfiguration,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x7decf9b4200b9131,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#notify_association_complete(
&self,
mut assoc_cfg: &WlanAssociationConfig,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseNotifyAssociationCompleteRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(assoc_cfg,),
0x436ffe3ba461d6cd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#clear_association(
&self,
mut payload: &WlanSoftmacBaseClearAssociationRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseClearAssociationRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x581d76c39190a7dd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#start_passive_scan(
&self,
mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseStartPassiveScanRequest,
fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
>(
payload,
0x5662f989cb4083bb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#start_active_scan(
&self,
mut payload: &WlanSoftmacStartActiveScanRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacStartActiveScanRequest,
fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
>(
payload,
0x4896eafa9937751e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#cancel_scan(
&self,
mut payload: &WlanSoftmacBaseCancelScanRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseCancelScanRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0xf7d859369764556,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#update_wmm_parameters(
&self,
mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBaseUpdateWmmParametersRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x68522c7122d5f78c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#start(
&self,
mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
mut ethernet_tx: u64,
mut wlan_rx: u64,
___deadline: zx::MonotonicInstant,
) -> Result<WlanSoftmacBridgeStartResult, fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacBridgeStartRequest,
fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>,
>(
(ifc_bridge, ethernet_tx, wlan_rx,),
0x7b2c15a507020d4d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.sme_channel))
}
pub fn r#set_ethernet_status(
&self,
mut status: u32,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self
.client
.send_query::<WlanSoftmacBridgeSetEthernetStatusRequest, fidl::encoding::EmptyPayload>(
(status,),
0x412503cb3aaa350b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct WlanSoftmacBridgeProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WlanSoftmacBridgeProxy {
type Protocol = WlanSoftmacBridgeMarker;
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 WlanSoftmacBridgeProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WlanSoftmacBridgeEventStream {
WlanSoftmacBridgeEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#query(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#query(self)
}
pub fn r#query_discovery_support(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryDiscoverySupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#query_discovery_support(self)
}
pub fn r#query_mac_sublayer_support(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryMacSublayerSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#query_mac_sublayer_support(self)
}
pub fn r#query_security_support(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQuerySecuritySupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#query_security_support(self)
}
pub fn r#query_spectrum_management_support(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseQuerySpectrumManagementSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#query_spectrum_management_support(self)
}
pub fn r#set_channel(
&self,
mut payload: &WlanSoftmacBaseSetChannelRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseSetChannelResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#set_channel(self, payload)
}
pub fn r#join_bss(
&self,
mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseJoinBssResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#join_bss(self, join_request)
}
pub fn r#enable_beaconing(
&self,
mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseEnableBeaconingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#enable_beaconing(self, payload)
}
pub fn r#disable_beaconing(
&self,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseDisableBeaconingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#disable_beaconing(self)
}
pub fn r#install_key(
&self,
mut payload: &WlanKeyConfiguration,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseInstallKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#install_key(self, payload)
}
pub fn r#notify_association_complete(
&self,
mut assoc_cfg: &WlanAssociationConfig,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseNotifyAssociationCompleteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#notify_association_complete(self, assoc_cfg)
}
pub fn r#clear_association(
&self,
mut payload: &WlanSoftmacBaseClearAssociationRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseClearAssociationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#clear_association(self, payload)
}
pub fn r#start_passive_scan(
&self,
mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseStartPassiveScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#start_passive_scan(self, payload)
}
pub fn r#start_active_scan(
&self,
mut payload: &WlanSoftmacStartActiveScanRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseStartActiveScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#start_active_scan(self, payload)
}
pub fn r#cancel_scan(
&self,
mut payload: &WlanSoftmacBaseCancelScanRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseCancelScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#cancel_scan(self, payload)
}
pub fn r#update_wmm_parameters(
&self,
mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBaseUpdateWmmParametersResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#update_wmm_parameters(self, payload)
}
pub fn r#start(
&self,
mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
mut ethernet_tx: u64,
mut wlan_rx: u64,
) -> fidl::client::QueryResponseFut<
WlanSoftmacBridgeStartResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanSoftmacBridgeProxyInterface::r#start(self, ifc_bridge, ethernet_tx, wlan_rx)
}
pub fn r#set_ethernet_status(
&self,
mut status: u32,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
WlanSoftmacBridgeProxyInterface::r#set_ethernet_status(self, status)
}
}
impl WlanSoftmacBridgeProxyInterface for WlanSoftmacBridgeProxy {
type QueryResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query(&self) -> Self::QueryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x18231a638e508f9d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, WlanSoftmacBaseQueryResult>(
(),
0x18231a638e508f9d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryDiscoverySupportResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryDiscoverySupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseQueryDiscoverySupportResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x16797affc0cb58ae,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseQueryDiscoverySupportResult,
>(
(),
0x16797affc0cb58ae,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryMacSublayerSupportResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQueryMacSublayerSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseQueryMacSublayerSupportResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7302c3f8c131f075,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseQueryMacSublayerSupportResult,
>(
(),
0x7302c3f8c131f075,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QuerySecuritySupportResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQuerySecuritySupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseQuerySecuritySupportResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3691bb75abf6354,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseQuerySecuritySupportResult,
>(
(),
0x3691bb75abf6354,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QuerySpectrumManagementSupportResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseQuerySpectrumManagementSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_spectrum_management_support(
&self,
) -> Self::QuerySpectrumManagementSupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
i32,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x347d78dc1d4d27bf,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseQuerySpectrumManagementSupportResult,
>(
(),
0x347d78dc1d4d27bf,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetChannelResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseSetChannelResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_channel(
&self,
mut payload: &WlanSoftmacBaseSetChannelRequest,
) -> Self::SetChannelResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x12836b533cd63ece,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseSetChannelRequest,
WlanSoftmacBaseSetChannelResult,
>(
payload,
0x12836b533cd63ece,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type JoinBssResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseJoinBssResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#join_bss(
&self,
mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
) -> Self::JoinBssResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1336fb5455b77a6e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<WlanSoftmacBaseJoinBssRequest, WlanSoftmacBaseJoinBssResult>(
(join_request,),
0x1336fb5455b77a6e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type EnableBeaconingResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseEnableBeaconingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#enable_beaconing(
&self,
mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
) -> Self::EnableBeaconingResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6c35807632c64576,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseEnableBeaconingRequest,
WlanSoftmacBaseEnableBeaconingResult,
>(
payload,
0x6c35807632c64576,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DisableBeaconingResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseDisableBeaconingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3303b30f99dbb406,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
WlanSoftmacBaseDisableBeaconingResult,
>(
(),
0x3303b30f99dbb406,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type InstallKeyResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseInstallKeyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#install_key(&self, mut payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7decf9b4200b9131,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResult>(
payload,
0x7decf9b4200b9131,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type NotifyAssociationCompleteResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseNotifyAssociationCompleteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#notify_association_complete(
&self,
mut assoc_cfg: &WlanAssociationConfig,
) -> Self::NotifyAssociationCompleteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x436ffe3ba461d6cd,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseNotifyAssociationCompleteRequest,
WlanSoftmacBaseNotifyAssociationCompleteResult,
>(
(assoc_cfg,),
0x436ffe3ba461d6cd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ClearAssociationResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseClearAssociationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#clear_association(
&self,
mut payload: &WlanSoftmacBaseClearAssociationRequest,
) -> Self::ClearAssociationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x581d76c39190a7dd,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseClearAssociationRequest,
WlanSoftmacBaseClearAssociationResult,
>(
payload,
0x581d76c39190a7dd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartPassiveScanResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseStartPassiveScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start_passive_scan(
&self,
mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
) -> Self::StartPassiveScanResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5662f989cb4083bb,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseStartPassiveScanRequest,
WlanSoftmacBaseStartPassiveScanResult,
>(
payload,
0x5662f989cb4083bb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartActiveScanResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseStartActiveScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start_active_scan(
&self,
mut payload: &WlanSoftmacStartActiveScanRequest,
) -> Self::StartActiveScanResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4896eafa9937751e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacStartActiveScanRequest,
WlanSoftmacBaseStartActiveScanResult,
>(
payload,
0x4896eafa9937751e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CancelScanResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseCancelScanResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#cancel_scan(
&self,
mut payload: &WlanSoftmacBaseCancelScanRequest,
) -> Self::CancelScanResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xf7d859369764556,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseCancelScanRequest,
WlanSoftmacBaseCancelScanResult,
>(
payload,
0xf7d859369764556,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UpdateWmmParametersResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBaseUpdateWmmParametersResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#update_wmm_parameters(
&self,
mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
) -> Self::UpdateWmmParametersResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x68522c7122d5f78c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
WlanSoftmacBaseUpdateWmmParametersRequest,
WlanSoftmacBaseUpdateWmmParametersResult,
>(
payload,
0x68522c7122d5f78c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartResponseFut = fidl::client::QueryResponseFut<
WlanSoftmacBridgeStartResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start(
&self,
mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
mut ethernet_tx: u64,
mut wlan_rx: u64,
) -> Self::StartResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanSoftmacBridgeStartResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7b2c15a507020d4d,
>(_buf?)?;
Ok(_response.map(|x| x.sme_channel))
}
self.client
.send_query_and_decode::<WlanSoftmacBridgeStartRequest, WlanSoftmacBridgeStartResult>(
(ifc_bridge, ethernet_tx, wlan_rx),
0x7b2c15a507020d4d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetEthernetStatusResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_ethernet_status(&self, mut status: u32) -> Self::SetEthernetStatusResponseFut {
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,
0x412503cb3aaa350b,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<WlanSoftmacBridgeSetEthernetStatusRequest, ()>(
(status,),
0x412503cb3aaa350b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WlanSoftmacBridgeEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WlanSoftmacBridgeEventStream {}
impl futures::stream::FusedStream for WlanSoftmacBridgeEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WlanSoftmacBridgeEventStream {
type Item = Result<WlanSoftmacBridgeEvent, 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(WlanSoftmacBridgeEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WlanSoftmacBridgeEvent {}
impl WlanSoftmacBridgeEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WlanSoftmacBridgeEvent, 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:
<WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WlanSoftmacBridgeRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WlanSoftmacBridgeRequestStream {}
impl futures::stream::FusedStream for WlanSoftmacBridgeRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WlanSoftmacBridgeRequestStream {
type Protocol = WlanSoftmacBridgeMarker;
type ControlHandle = WlanSoftmacBridgeControlHandle;
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 {
WlanSoftmacBridgeControlHandle { 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 WlanSoftmacBridgeRequestStream {
type Item = Result<WlanSoftmacBridgeRequest, 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 WlanSoftmacBridgeRequestStream 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 {
0x18231a638e508f9d => {
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 =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::Query {
responder: WlanSoftmacBridgeQueryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x16797affc0cb58ae => {
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 =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::QueryDiscoverySupport {
responder: WlanSoftmacBridgeQueryDiscoverySupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7302c3f8c131f075 => {
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 =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::QueryMacSublayerSupport {
responder: WlanSoftmacBridgeQueryMacSublayerSupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3691bb75abf6354 => {
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 =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::QuerySecuritySupport {
responder: WlanSoftmacBridgeQuerySecuritySupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x347d78dc1d4d27bf => {
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 =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport {
responder: WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x12836b533cd63ece => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseSetChannelRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseSetChannelRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::SetChannel {
payload: req,
responder: WlanSoftmacBridgeSetChannelResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1336fb5455b77a6e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseJoinBssRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseJoinBssRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::JoinBss {
join_request: req.join_request,
responder: WlanSoftmacBridgeJoinBssResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6c35807632c64576 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseEnableBeaconingRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseEnableBeaconingRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::EnableBeaconing {
payload: req,
responder: WlanSoftmacBridgeEnableBeaconingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3303b30f99dbb406 => {
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 =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::DisableBeaconing {
responder: WlanSoftmacBridgeDisableBeaconingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7decf9b4200b9131 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanKeyConfiguration,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanKeyConfiguration>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::InstallKey {
payload: req,
responder: WlanSoftmacBridgeInstallKeyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x436ffe3ba461d6cd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseNotifyAssociationCompleteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::NotifyAssociationComplete {
assoc_cfg: req.assoc_cfg,
responder: WlanSoftmacBridgeNotifyAssociationCompleteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x581d76c39190a7dd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseClearAssociationRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseClearAssociationRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::ClearAssociation {
payload: req,
responder: WlanSoftmacBridgeClearAssociationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5662f989cb4083bb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseStartPassiveScanRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseStartPassiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::StartPassiveScan {
payload: req,
responder: WlanSoftmacBridgeStartPassiveScanResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4896eafa9937751e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacStartActiveScanRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacStartActiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::StartActiveScan {
payload: req,
responder: WlanSoftmacBridgeStartActiveScanResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xf7d859369764556 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseCancelScanRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseCancelScanRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::CancelScan {
payload: req,
responder: WlanSoftmacBridgeCancelScanResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x68522c7122d5f78c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBaseUpdateWmmParametersRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseUpdateWmmParametersRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::UpdateWmmParameters {
payload: req,
responder: WlanSoftmacBridgeUpdateWmmParametersResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7b2c15a507020d4d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBridgeStartRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBridgeStartRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::Start {
ifc_bridge: req.ifc_bridge,
ethernet_tx: req.ethernet_tx,
wlan_rx: req.wlan_rx,
responder: WlanSoftmacBridgeStartResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x412503cb3aaa350b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanSoftmacBridgeSetEthernetStatusRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBridgeSetEthernetStatusRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
Ok(WlanSoftmacBridgeRequest::SetEthernetStatus {
status: req.status,
responder: WlanSoftmacBridgeSetEthernetStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WlanSoftmacBridgeRequest {
Query { responder: WlanSoftmacBridgeQueryResponder },
QueryDiscoverySupport { responder: WlanSoftmacBridgeQueryDiscoverySupportResponder },
QueryMacSublayerSupport { responder: WlanSoftmacBridgeQueryMacSublayerSupportResponder },
QuerySecuritySupport { responder: WlanSoftmacBridgeQuerySecuritySupportResponder },
QuerySpectrumManagementSupport {
responder: WlanSoftmacBridgeQuerySpectrumManagementSupportResponder,
},
SetChannel {
payload: WlanSoftmacBaseSetChannelRequest,
responder: WlanSoftmacBridgeSetChannelResponder,
},
JoinBss {
join_request: fidl_fuchsia_wlan_common::JoinBssRequest,
responder: WlanSoftmacBridgeJoinBssResponder,
},
EnableBeaconing {
payload: WlanSoftmacBaseEnableBeaconingRequest,
responder: WlanSoftmacBridgeEnableBeaconingResponder,
},
DisableBeaconing { responder: WlanSoftmacBridgeDisableBeaconingResponder },
InstallKey { payload: WlanKeyConfiguration, responder: WlanSoftmacBridgeInstallKeyResponder },
NotifyAssociationComplete {
assoc_cfg: WlanAssociationConfig,
responder: WlanSoftmacBridgeNotifyAssociationCompleteResponder,
},
ClearAssociation {
payload: WlanSoftmacBaseClearAssociationRequest,
responder: WlanSoftmacBridgeClearAssociationResponder,
},
StartPassiveScan {
payload: WlanSoftmacBaseStartPassiveScanRequest,
responder: WlanSoftmacBridgeStartPassiveScanResponder,
},
StartActiveScan {
payload: WlanSoftmacStartActiveScanRequest,
responder: WlanSoftmacBridgeStartActiveScanResponder,
},
CancelScan {
payload: WlanSoftmacBaseCancelScanRequest,
responder: WlanSoftmacBridgeCancelScanResponder,
},
UpdateWmmParameters {
payload: WlanSoftmacBaseUpdateWmmParametersRequest,
responder: WlanSoftmacBridgeUpdateWmmParametersResponder,
},
Start {
ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
ethernet_tx: u64,
wlan_rx: u64,
responder: WlanSoftmacBridgeStartResponder,
},
SetEthernetStatus { status: u32, responder: WlanSoftmacBridgeSetEthernetStatusResponder },
}
impl WlanSoftmacBridgeRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_query(self) -> Option<(WlanSoftmacBridgeQueryResponder)> {
if let WlanSoftmacBridgeRequest::Query { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_discovery_support(
self,
) -> Option<(WlanSoftmacBridgeQueryDiscoverySupportResponder)> {
if let WlanSoftmacBridgeRequest::QueryDiscoverySupport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_mac_sublayer_support(
self,
) -> Option<(WlanSoftmacBridgeQueryMacSublayerSupportResponder)> {
if let WlanSoftmacBridgeRequest::QueryMacSublayerSupport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_security_support(
self,
) -> Option<(WlanSoftmacBridgeQuerySecuritySupportResponder)> {
if let WlanSoftmacBridgeRequest::QuerySecuritySupport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_spectrum_management_support(
self,
) -> Option<(WlanSoftmacBridgeQuerySpectrumManagementSupportResponder)> {
if let WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_channel(
self,
) -> Option<(WlanSoftmacBaseSetChannelRequest, WlanSoftmacBridgeSetChannelResponder)> {
if let WlanSoftmacBridgeRequest::SetChannel { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_join_bss(
self,
) -> Option<(fidl_fuchsia_wlan_common::JoinBssRequest, WlanSoftmacBridgeJoinBssResponder)> {
if let WlanSoftmacBridgeRequest::JoinBss { join_request, responder } = self {
Some((join_request, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_enable_beaconing(
self,
) -> Option<(WlanSoftmacBaseEnableBeaconingRequest, WlanSoftmacBridgeEnableBeaconingResponder)>
{
if let WlanSoftmacBridgeRequest::EnableBeaconing { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_disable_beaconing(self) -> Option<(WlanSoftmacBridgeDisableBeaconingResponder)> {
if let WlanSoftmacBridgeRequest::DisableBeaconing { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_install_key(
self,
) -> Option<(WlanKeyConfiguration, WlanSoftmacBridgeInstallKeyResponder)> {
if let WlanSoftmacBridgeRequest::InstallKey { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_notify_association_complete(
self,
) -> Option<(WlanAssociationConfig, WlanSoftmacBridgeNotifyAssociationCompleteResponder)> {
if let WlanSoftmacBridgeRequest::NotifyAssociationComplete { assoc_cfg, responder } = self {
Some((assoc_cfg, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clear_association(
self,
) -> Option<(WlanSoftmacBaseClearAssociationRequest, WlanSoftmacBridgeClearAssociationResponder)>
{
if let WlanSoftmacBridgeRequest::ClearAssociation { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_passive_scan(
self,
) -> Option<(WlanSoftmacBaseStartPassiveScanRequest, WlanSoftmacBridgeStartPassiveScanResponder)>
{
if let WlanSoftmacBridgeRequest::StartPassiveScan { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_active_scan(
self,
) -> Option<(WlanSoftmacStartActiveScanRequest, WlanSoftmacBridgeStartActiveScanResponder)>
{
if let WlanSoftmacBridgeRequest::StartActiveScan { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_cancel_scan(
self,
) -> Option<(WlanSoftmacBaseCancelScanRequest, WlanSoftmacBridgeCancelScanResponder)> {
if let WlanSoftmacBridgeRequest::CancelScan { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_update_wmm_parameters(
self,
) -> Option<(
WlanSoftmacBaseUpdateWmmParametersRequest,
WlanSoftmacBridgeUpdateWmmParametersResponder,
)> {
if let WlanSoftmacBridgeRequest::UpdateWmmParameters { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start(
self,
) -> Option<(
fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
u64,
u64,
WlanSoftmacBridgeStartResponder,
)> {
if let WlanSoftmacBridgeRequest::Start { ifc_bridge, ethernet_tx, wlan_rx, responder } =
self
{
Some((ifc_bridge, ethernet_tx, wlan_rx, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_ethernet_status(
self,
) -> Option<(u32, WlanSoftmacBridgeSetEthernetStatusResponder)> {
if let WlanSoftmacBridgeRequest::SetEthernetStatus { status, responder } = self {
Some((status, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WlanSoftmacBridgeRequest::Query { .. } => "query",
WlanSoftmacBridgeRequest::QueryDiscoverySupport { .. } => "query_discovery_support",
WlanSoftmacBridgeRequest::QueryMacSublayerSupport { .. } => {
"query_mac_sublayer_support"
}
WlanSoftmacBridgeRequest::QuerySecuritySupport { .. } => "query_security_support",
WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport { .. } => {
"query_spectrum_management_support"
}
WlanSoftmacBridgeRequest::SetChannel { .. } => "set_channel",
WlanSoftmacBridgeRequest::JoinBss { .. } => "join_bss",
WlanSoftmacBridgeRequest::EnableBeaconing { .. } => "enable_beaconing",
WlanSoftmacBridgeRequest::DisableBeaconing { .. } => "disable_beaconing",
WlanSoftmacBridgeRequest::InstallKey { .. } => "install_key",
WlanSoftmacBridgeRequest::NotifyAssociationComplete { .. } => {
"notify_association_complete"
}
WlanSoftmacBridgeRequest::ClearAssociation { .. } => "clear_association",
WlanSoftmacBridgeRequest::StartPassiveScan { .. } => "start_passive_scan",
WlanSoftmacBridgeRequest::StartActiveScan { .. } => "start_active_scan",
WlanSoftmacBridgeRequest::CancelScan { .. } => "cancel_scan",
WlanSoftmacBridgeRequest::UpdateWmmParameters { .. } => "update_wmm_parameters",
WlanSoftmacBridgeRequest::Start { .. } => "start",
WlanSoftmacBridgeRequest::SetEthernetStatus { .. } => "set_ethernet_status",
}
}
}
#[derive(Debug, Clone)]
pub struct WlanSoftmacBridgeControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WlanSoftmacBridgeControlHandle {
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 WlanSoftmacBridgeControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeQueryResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeQueryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeQueryResponder {
pub fn send(
self,
mut result: Result<&WlanSoftmacQueryResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&WlanSoftmacQueryResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&WlanSoftmacQueryResponse, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>>(
result,
self.tx_id,
0x18231a638e508f9d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeQueryDiscoverySupportResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeQueryDiscoverySupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryDiscoverySupportResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeQueryDiscoverySupportResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseQueryDiscoverySupportResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x16797affc0cb58ae,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeQueryMacSublayerSupportResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeQueryMacSublayerSupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryMacSublayerSupportResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeQueryMacSublayerSupportResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseQueryMacSublayerSupportResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x7302c3f8c131f075,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeQuerySecuritySupportResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeQuerySecuritySupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeQuerySecuritySupportResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeQuerySecuritySupportResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseQuerySecuritySupportResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x3691bb75abf6354,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x347d78dc1d4d27bf,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeSetChannelResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeSetChannelResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeSetChannelResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeSetChannelResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x12836b533cd63ece,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeJoinBssResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeJoinBssResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeJoinBssResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeJoinBssResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x1336fb5455b77a6e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeEnableBeaconingResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeEnableBeaconingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeEnableBeaconingResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeEnableBeaconingResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x6c35807632c64576,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeDisableBeaconingResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeDisableBeaconingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeDisableBeaconingResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeDisableBeaconingResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3303b30f99dbb406,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeInstallKeyResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeInstallKeyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeInstallKeyResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeInstallKeyResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x7decf9b4200b9131,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeNotifyAssociationCompleteResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeNotifyAssociationCompleteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeNotifyAssociationCompleteResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeNotifyAssociationCompleteResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x436ffe3ba461d6cd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeClearAssociationResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeClearAssociationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeClearAssociationResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeClearAssociationResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x581d76c39190a7dd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeStartPassiveScanResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeStartPassiveScanResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeStartPassiveScanResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeStartPassiveScanResponder {
pub fn send(
self,
mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseStartPassiveScanResponse,
i32,
>>(
result,
self.tx_id,
0x5662f989cb4083bb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeStartActiveScanResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeStartActiveScanResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeStartActiveScanResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeStartActiveScanResponder {
pub fn send(
self,
mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
WlanSoftmacBaseStartActiveScanResponse,
i32,
>>(
result,
self.tx_id,
0x4896eafa9937751e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeCancelScanResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeCancelScanResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeCancelScanResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeCancelScanResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0xf7d859369764556,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeUpdateWmmParametersResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeUpdateWmmParametersResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeUpdateWmmParametersResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeUpdateWmmParametersResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x68522c7122d5f78c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeStartResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeStartResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeStartResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeStartResponder {
pub fn send(self, mut result: Result<fidl::Channel, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl::Channel, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<fidl::Channel, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>>(
result.map(|sme_channel| (sme_channel,)),
self.tx_id,
0x7b2c15a507020d4d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacBridgeSetEthernetStatusResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacBridgeSetEthernetStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacBridgeSetEthernetStatusResponder {
type ControlHandle = WlanSoftmacBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacBridgeSetEthernetStatusResponder {
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,
0x412503cb3aaa350b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WlanSoftmacIfcBaseMarker;
impl fidl::endpoints::ProtocolMarker for WlanSoftmacIfcBaseMarker {
type Proxy = WlanSoftmacIfcBaseProxy;
type RequestStream = WlanSoftmacIfcBaseRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WlanSoftmacIfcBaseSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacIfcBase";
}
pub trait WlanSoftmacIfcBaseProxyInterface: Send + Sync {
type ReportTxResultResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#report_tx_result(
&self,
tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> Self::ReportTxResultResponseFut;
type NotifyScanCompleteResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#notify_scan_complete(
&self,
payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
) -> Self::NotifyScanCompleteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WlanSoftmacIfcBaseSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WlanSoftmacIfcBaseSynchronousProxy {
type Proxy = WlanSoftmacIfcBaseProxy;
type Protocol = WlanSoftmacIfcBaseMarker;
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 WlanSoftmacIfcBaseSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<WlanSoftmacIfcBaseMarker 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<WlanSoftmacIfcBaseEvent, fidl::Error> {
WlanSoftmacIfcBaseEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#report_tx_result(
&self,
mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self
.client
.send_query::<WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::EmptyPayload>(
(tx_result,),
0x5835c2f13d94e09a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#notify_scan_complete(
&self,
mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacIfcBaseNotifyScanCompleteRequest,
fidl::encoding::EmptyPayload,
>(
payload,
0x7045e3cd460dc42c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct WlanSoftmacIfcBaseProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WlanSoftmacIfcBaseProxy {
type Protocol = WlanSoftmacIfcBaseMarker;
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 WlanSoftmacIfcBaseProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WlanSoftmacIfcBaseEventStream {
WlanSoftmacIfcBaseEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#report_tx_result(
&self,
mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
WlanSoftmacIfcBaseProxyInterface::r#report_tx_result(self, tx_result)
}
pub fn r#notify_scan_complete(
&self,
mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
WlanSoftmacIfcBaseProxyInterface::r#notify_scan_complete(self, payload)
}
}
impl WlanSoftmacIfcBaseProxyInterface for WlanSoftmacIfcBaseProxy {
type ReportTxResultResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#report_tx_result(
&self,
mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> Self::ReportTxResultResponseFut {
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,
0x5835c2f13d94e09a,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<WlanSoftmacIfcBaseReportTxResultRequest, ()>(
(tx_result,),
0x5835c2f13d94e09a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type NotifyScanCompleteResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#notify_scan_complete(
&self,
mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
) -> Self::NotifyScanCompleteResponseFut {
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,
0x7045e3cd460dc42c,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<WlanSoftmacIfcBaseNotifyScanCompleteRequest, ()>(
payload,
0x7045e3cd460dc42c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WlanSoftmacIfcBaseEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WlanSoftmacIfcBaseEventStream {}
impl futures::stream::FusedStream for WlanSoftmacIfcBaseEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WlanSoftmacIfcBaseEventStream {
type Item = Result<WlanSoftmacIfcBaseEvent, 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(WlanSoftmacIfcBaseEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WlanSoftmacIfcBaseEvent {}
impl WlanSoftmacIfcBaseEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WlanSoftmacIfcBaseEvent, 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:
<WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WlanSoftmacIfcBaseRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WlanSoftmacIfcBaseRequestStream {}
impl futures::stream::FusedStream for WlanSoftmacIfcBaseRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WlanSoftmacIfcBaseRequestStream {
type Protocol = WlanSoftmacIfcBaseMarker;
type ControlHandle = WlanSoftmacIfcBaseControlHandle;
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 {
WlanSoftmacIfcBaseControlHandle { 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 WlanSoftmacIfcBaseRequestStream {
type Item = Result<WlanSoftmacIfcBaseRequest, 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 WlanSoftmacIfcBaseRequestStream 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 {
0x5835c2f13d94e09a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseReportTxResultRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlanSoftmacIfcBaseControlHandle {
inner: this.inner.clone(),
};
Ok(WlanSoftmacIfcBaseRequest::ReportTxResult {tx_result: req.tx_result,
responder: WlanSoftmacIfcBaseReportTxResultResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7045e3cd460dc42c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(WlanSoftmacIfcBaseNotifyScanCompleteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlanSoftmacIfcBaseControlHandle {
inner: this.inner.clone(),
};
Ok(WlanSoftmacIfcBaseRequest::NotifyScanComplete {payload: req,
responder: WlanSoftmacIfcBaseNotifyScanCompleteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WlanSoftmacIfcBaseRequest {
ReportTxResult {
tx_result: fidl_fuchsia_wlan_common::WlanTxResult,
responder: WlanSoftmacIfcBaseReportTxResultResponder,
},
NotifyScanComplete {
payload: WlanSoftmacIfcBaseNotifyScanCompleteRequest,
responder: WlanSoftmacIfcBaseNotifyScanCompleteResponder,
},
}
impl WlanSoftmacIfcBaseRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_report_tx_result(
self,
) -> Option<(fidl_fuchsia_wlan_common::WlanTxResult, WlanSoftmacIfcBaseReportTxResultResponder)>
{
if let WlanSoftmacIfcBaseRequest::ReportTxResult { tx_result, responder } = self {
Some((tx_result, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_notify_scan_complete(
self,
) -> Option<(
WlanSoftmacIfcBaseNotifyScanCompleteRequest,
WlanSoftmacIfcBaseNotifyScanCompleteResponder,
)> {
if let WlanSoftmacIfcBaseRequest::NotifyScanComplete { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WlanSoftmacIfcBaseRequest::ReportTxResult { .. } => "report_tx_result",
WlanSoftmacIfcBaseRequest::NotifyScanComplete { .. } => "notify_scan_complete",
}
}
}
#[derive(Debug, Clone)]
pub struct WlanSoftmacIfcBaseControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WlanSoftmacIfcBaseControlHandle {
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 WlanSoftmacIfcBaseControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacIfcBaseReportTxResultResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacIfcBaseReportTxResultResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacIfcBaseReportTxResultResponder {
type ControlHandle = WlanSoftmacIfcBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacIfcBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacIfcBaseReportTxResultResponder {
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,
0x5835c2f13d94e09a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacIfcBaseNotifyScanCompleteResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBaseControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacIfcBaseNotifyScanCompleteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacIfcBaseNotifyScanCompleteResponder {
type ControlHandle = WlanSoftmacIfcBaseControlHandle;
fn control_handle(&self) -> &WlanSoftmacIfcBaseControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacIfcBaseNotifyScanCompleteResponder {
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,
0x7045e3cd460dc42c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WlanSoftmacIfcBridgeMarker;
impl fidl::endpoints::ProtocolMarker for WlanSoftmacIfcBridgeMarker {
type Proxy = WlanSoftmacIfcBridgeProxy;
type RequestStream = WlanSoftmacIfcBridgeRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WlanSoftmacIfcBridgeSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacIfcBridge";
}
pub trait WlanSoftmacIfcBridgeProxyInterface: Send + Sync {
type ReportTxResultResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#report_tx_result(
&self,
tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> Self::ReportTxResultResponseFut;
type NotifyScanCompleteResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#notify_scan_complete(
&self,
payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
) -> Self::NotifyScanCompleteResponseFut;
type StopBridgedDriverResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#stop_bridged_driver(&self) -> Self::StopBridgedDriverResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WlanSoftmacIfcBridgeSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WlanSoftmacIfcBridgeSynchronousProxy {
type Proxy = WlanSoftmacIfcBridgeProxy;
type Protocol = WlanSoftmacIfcBridgeMarker;
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 WlanSoftmacIfcBridgeSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<WlanSoftmacIfcBridgeMarker 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<WlanSoftmacIfcBridgeEvent, fidl::Error> {
WlanSoftmacIfcBridgeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#report_tx_result(
&self,
mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self
.client
.send_query::<WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::EmptyPayload>(
(tx_result,),
0x5835c2f13d94e09a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#notify_scan_complete(
&self,
mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
WlanSoftmacIfcBaseNotifyScanCompleteRequest,
fidl::encoding::EmptyPayload,
>(
payload,
0x7045e3cd460dc42c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#stop_bridged_driver(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x112dbd0cc2251151,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct WlanSoftmacIfcBridgeProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WlanSoftmacIfcBridgeProxy {
type Protocol = WlanSoftmacIfcBridgeMarker;
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 WlanSoftmacIfcBridgeProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WlanSoftmacIfcBridgeEventStream {
WlanSoftmacIfcBridgeEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#report_tx_result(
&self,
mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
WlanSoftmacIfcBridgeProxyInterface::r#report_tx_result(self, tx_result)
}
pub fn r#notify_scan_complete(
&self,
mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
WlanSoftmacIfcBridgeProxyInterface::r#notify_scan_complete(self, payload)
}
pub fn r#stop_bridged_driver(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
WlanSoftmacIfcBridgeProxyInterface::r#stop_bridged_driver(self)
}
}
impl WlanSoftmacIfcBridgeProxyInterface for WlanSoftmacIfcBridgeProxy {
type ReportTxResultResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#report_tx_result(
&self,
mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> Self::ReportTxResultResponseFut {
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,
0x5835c2f13d94e09a,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<WlanSoftmacIfcBaseReportTxResultRequest, ()>(
(tx_result,),
0x5835c2f13d94e09a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type NotifyScanCompleteResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#notify_scan_complete(
&self,
mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
) -> Self::NotifyScanCompleteResponseFut {
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,
0x7045e3cd460dc42c,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<WlanSoftmacIfcBaseNotifyScanCompleteRequest, ()>(
payload,
0x7045e3cd460dc42c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopBridgedDriverResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#stop_bridged_driver(&self) -> Self::StopBridgedDriverResponseFut {
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,
0x112dbd0cc2251151,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x112dbd0cc2251151,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WlanSoftmacIfcBridgeEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WlanSoftmacIfcBridgeEventStream {}
impl futures::stream::FusedStream for WlanSoftmacIfcBridgeEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WlanSoftmacIfcBridgeEventStream {
type Item = Result<WlanSoftmacIfcBridgeEvent, 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(WlanSoftmacIfcBridgeEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WlanSoftmacIfcBridgeEvent {}
impl WlanSoftmacIfcBridgeEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WlanSoftmacIfcBridgeEvent, 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:
<WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WlanSoftmacIfcBridgeRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WlanSoftmacIfcBridgeRequestStream {}
impl futures::stream::FusedStream for WlanSoftmacIfcBridgeRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WlanSoftmacIfcBridgeRequestStream {
type Protocol = WlanSoftmacIfcBridgeMarker;
type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
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 {
WlanSoftmacIfcBridgeControlHandle { 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 WlanSoftmacIfcBridgeRequestStream {
type Item = Result<WlanSoftmacIfcBridgeRequest, 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 WlanSoftmacIfcBridgeRequestStream 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 {
0x5835c2f13d94e09a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseReportTxResultRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlanSoftmacIfcBridgeControlHandle {
inner: this.inner.clone(),
};
Ok(WlanSoftmacIfcBridgeRequest::ReportTxResult {tx_result: req.tx_result,
responder: WlanSoftmacIfcBridgeReportTxResultResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7045e3cd460dc42c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(WlanSoftmacIfcBaseNotifyScanCompleteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlanSoftmacIfcBridgeControlHandle {
inner: this.inner.clone(),
};
Ok(WlanSoftmacIfcBridgeRequest::NotifyScanComplete {payload: req,
responder: WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x112dbd0cc2251151 => {
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 = WlanSoftmacIfcBridgeControlHandle {
inner: this.inner.clone(),
};
Ok(WlanSoftmacIfcBridgeRequest::StopBridgedDriver {
responder: WlanSoftmacIfcBridgeStopBridgedDriverResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WlanSoftmacIfcBridgeRequest {
ReportTxResult {
tx_result: fidl_fuchsia_wlan_common::WlanTxResult,
responder: WlanSoftmacIfcBridgeReportTxResultResponder,
},
NotifyScanComplete {
payload: WlanSoftmacIfcBaseNotifyScanCompleteRequest,
responder: WlanSoftmacIfcBridgeNotifyScanCompleteResponder,
},
StopBridgedDriver { responder: WlanSoftmacIfcBridgeStopBridgedDriverResponder },
}
impl WlanSoftmacIfcBridgeRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_report_tx_result(
self,
) -> Option<(fidl_fuchsia_wlan_common::WlanTxResult, WlanSoftmacIfcBridgeReportTxResultResponder)>
{
if let WlanSoftmacIfcBridgeRequest::ReportTxResult { tx_result, responder } = self {
Some((tx_result, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_notify_scan_complete(
self,
) -> Option<(
WlanSoftmacIfcBaseNotifyScanCompleteRequest,
WlanSoftmacIfcBridgeNotifyScanCompleteResponder,
)> {
if let WlanSoftmacIfcBridgeRequest::NotifyScanComplete { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_bridged_driver(
self,
) -> Option<(WlanSoftmacIfcBridgeStopBridgedDriverResponder)> {
if let WlanSoftmacIfcBridgeRequest::StopBridgedDriver { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WlanSoftmacIfcBridgeRequest::ReportTxResult { .. } => "report_tx_result",
WlanSoftmacIfcBridgeRequest::NotifyScanComplete { .. } => "notify_scan_complete",
WlanSoftmacIfcBridgeRequest::StopBridgedDriver { .. } => "stop_bridged_driver",
}
}
}
#[derive(Debug, Clone)]
pub struct WlanSoftmacIfcBridgeControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WlanSoftmacIfcBridgeControlHandle {
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 WlanSoftmacIfcBridgeControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacIfcBridgeReportTxResultResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacIfcBridgeReportTxResultResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeReportTxResultResponder {
type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacIfcBridgeReportTxResultResponder {
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,
0x5835c2f13d94e09a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
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,
0x7045e3cd460dc42c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanSoftmacIfcBridgeStopBridgedDriverResponder {
control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanSoftmacIfcBridgeStopBridgedDriverResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeStopBridgedDriverResponder {
type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanSoftmacIfcBridgeStopBridgedDriverResponder {
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,
0x112dbd0cc2251151,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WlanTxMarker;
impl fidl::endpoints::ProtocolMarker for WlanTxMarker {
type Proxy = WlanTxProxy;
type RequestStream = WlanTxRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WlanTxSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) WlanTx";
}
pub type WlanTxTransferResult = Result<(), i32>;
pub trait WlanTxProxyInterface: Send + Sync {
type TransferResponseFut: std::future::Future<Output = Result<WlanTxTransferResult, fidl::Error>>
+ Send;
fn r#transfer(&self, payload: &WlanTxTransferRequest) -> Self::TransferResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WlanTxSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WlanTxSynchronousProxy {
type Proxy = WlanTxProxy;
type Protocol = WlanTxMarker;
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 WlanTxSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <WlanTxMarker 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<WlanTxEvent, fidl::Error> {
WlanTxEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#transfer(
&self,
mut payload: &WlanTxTransferRequest,
___deadline: zx::MonotonicInstant,
) -> Result<WlanTxTransferResult, fidl::Error> {
let _response = self.client.send_query::<
WlanTxTransferRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x19f8ff7a8b910ab3,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct WlanTxProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WlanTxProxy {
type Protocol = WlanTxMarker;
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 WlanTxProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WlanTxEventStream {
WlanTxEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#transfer(
&self,
mut payload: &WlanTxTransferRequest,
) -> fidl::client::QueryResponseFut<
WlanTxTransferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WlanTxProxyInterface::r#transfer(self, payload)
}
}
impl WlanTxProxyInterface for WlanTxProxy {
type TransferResponseFut = fidl::client::QueryResponseFut<
WlanTxTransferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#transfer(&self, mut payload: &WlanTxTransferRequest) -> Self::TransferResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WlanTxTransferResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x19f8ff7a8b910ab3,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<WlanTxTransferRequest, WlanTxTransferResult>(
payload,
0x19f8ff7a8b910ab3,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WlanTxEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WlanTxEventStream {}
impl futures::stream::FusedStream for WlanTxEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WlanTxEventStream {
type Item = Result<WlanTxEvent, 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(WlanTxEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WlanTxEvent {}
impl WlanTxEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WlanTxEvent, 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: <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WlanTxRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WlanTxRequestStream {}
impl futures::stream::FusedStream for WlanTxRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WlanTxRequestStream {
type Protocol = WlanTxMarker;
type ControlHandle = WlanTxControlHandle;
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 {
WlanTxControlHandle { 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 WlanTxRequestStream {
type Item = Result<WlanTxRequest, 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 WlanTxRequestStream 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 {
0x19f8ff7a8b910ab3 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlanTxTransferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanTxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlanTxControlHandle { inner: this.inner.clone() };
Ok(WlanTxRequest::Transfer {
payload: req,
responder: WlanTxTransferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WlanTxRequest {
Transfer { payload: WlanTxTransferRequest, responder: WlanTxTransferResponder },
}
impl WlanTxRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_transfer(self) -> Option<(WlanTxTransferRequest, WlanTxTransferResponder)> {
if let WlanTxRequest::Transfer { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WlanTxRequest::Transfer { .. } => "transfer",
}
}
}
#[derive(Debug, Clone)]
pub struct WlanTxControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WlanTxControlHandle {
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 WlanTxControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlanTxTransferResponder {
control_handle: std::mem::ManuallyDrop<WlanTxControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlanTxTransferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlanTxTransferResponder {
type ControlHandle = WlanTxControlHandle;
fn control_handle(&self) -> &WlanTxControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlanTxTransferResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x19f8ff7a8b910ab3,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for WlanRxInfoFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for WlanRxInfoFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for WlanRxInfoFlags
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WlanRxInfoValid {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for WlanRxInfoValid {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for WlanRxInfoValid
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoValid {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WlanTxInfoFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for WlanTxInfoFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for WlanTxInfoFlags
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WlanTxInfoValid {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for WlanTxInfoValid {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for WlanTxInfoValid
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoValid {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WlanProtection {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for WlanProtection {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanProtection {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanProtection {
#[inline(always)]
fn new_empty() -> Self {
Self::None
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
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(
(
<WlanRxInfoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_flags),
<WlanRxInfoValid 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<WlanRxInfoFlags, D>,
T1: fidl::encoding::Encode<WlanRxInfoValid, 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!(WlanRxInfoFlags, D),
valid_fields: fidl::new_empty!(WlanRxInfoValid, 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!(WlanRxInfoFlags, D, &mut self.rx_flags, decoder, offset + 0, _depth)?;
fidl::decode!(WlanRxInfoValid, 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 WlanRxPacket {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanRxPacket {
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<WlanRxPacket, D>
for &WlanRxPacket
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanRxPacket>(offset);
fidl::encoding::Encode::<WlanRxPacket, D>::encode(
(
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
<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<WlanRxPacket, 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::<WlanRxPacket>(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 WlanRxPacket {
#[inline(always)]
fn new_empty() -> Self {
Self {
mac_frame: 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.mac_frame,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseJoinBssRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseJoinBssRequest {
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<WlanSoftmacBaseJoinBssRequest, D>
for &WlanSoftmacBaseJoinBssRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
fidl::encoding::Encode::<WlanSoftmacBaseJoinBssRequest, D>::encode(
(
<fidl_fuchsia_wlan_common::JoinBssRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.join_request),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::JoinBssRequest, D>,
> fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, 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::<WlanSoftmacBaseJoinBssRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseJoinBssRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { join_request: 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);
fidl::decode!(
fidl_fuchsia_wlan_common::JoinBssRequest,
D,
&mut self.join_request,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
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<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>
for &WlanSoftmacBaseNotifyAssociationCompleteRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
fidl::encoding::Encode::<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>::encode(
(<WlanAssociationConfig as fidl::encoding::ValueTypeMarker>::borrow(
&self.assoc_cfg,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<WlanAssociationConfig, D>,
> fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, 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::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseNotifyAssociationCompleteRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { assoc_cfg: fidl::new_empty!(WlanAssociationConfig, 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!(
WlanAssociationConfig,
D,
&mut self.assoc_cfg,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
3
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D>
for &WlanSoftmacBaseQueryDiscoverySupportResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
fidl::encoding::Encode::<WlanSoftmacBaseQueryDiscoverySupportResponse, D>::encode(
(
<fidl_fuchsia_wlan_common::DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::DiscoverySupport, D>,
> fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, 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::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseQueryDiscoverySupportResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::DiscoverySupport, 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::DiscoverySupport,
D,
&mut self.resp,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
5
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>
for &WlanSoftmacBaseQueryMacSublayerSupportResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
fidl::encoding::Encode::<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>::encode(
(
<fidl_fuchsia_wlan_common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::MacSublayerSupport, D>,
> fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, 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::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseQueryMacSublayerSupportResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::MacSublayerSupport, 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::MacSublayerSupport,
D,
&mut self.resp,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
3
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D>
for &WlanSoftmacBaseQuerySecuritySupportResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
fidl::encoding::Encode::<WlanSoftmacBaseQuerySecuritySupportResponse, D>::encode(
(
<fidl_fuchsia_wlan_common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SecuritySupport, D>,
> fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, 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::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseQuerySecuritySupportResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::SecuritySupport, 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::SecuritySupport,
D,
&mut self.resp,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>
for &WlanSoftmacBaseQuerySpectrumManagementSupportResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
offset,
);
fidl::encoding::Encode::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>::encode(
(
<fidl_fuchsia_wlan_common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SpectrumManagementSupport, D>,
> fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, 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::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
offset,
);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseQuerySpectrumManagementSupportResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resp: 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);
fidl::decode!(
fidl_fuchsia_wlan_common::SpectrumManagementSupport,
D,
&mut self.resp,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
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<WlanSoftmacBridgeSetEthernetStatusRequest, D>
for &WlanSoftmacBridgeSetEthernetStatusRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut WlanSoftmacBridgeSetEthernetStatusRequest).write_unaligned(
(self as *const WlanSoftmacBridgeSetEthernetStatusRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, 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::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBridgeSetEthernetStatusRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for WlanSoftmacBridgeStartRequest {
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 WlanSoftmacBridgeStartRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
WlanSoftmacBridgeStartRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut WlanSoftmacBridgeStartRequest
{
#[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::<WlanSoftmacBridgeStartRequest>(offset);
fidl::encoding::Encode::<
WlanSoftmacBridgeStartRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.ifc_bridge
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.ethernet_tx),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_rx),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
WlanSoftmacBridgeStartRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBridgeStartRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for WlanSoftmacBridgeStartRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
ifc_bridge: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
ethernet_tx: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
wlan_rx: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ifc_bridge,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ethernet_tx,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.wlan_rx,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for WlanSoftmacBridgeStartResponse {
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 WlanSoftmacBridgeStartResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
WlanSoftmacBridgeStartResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut WlanSoftmacBridgeStartResponse
{
#[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::<WlanSoftmacBridgeStartResponse>(offset);
fidl::encoding::Encode::<
WlanSoftmacBridgeStartResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.sme_channel
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
WlanSoftmacBridgeStartResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBridgeStartResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for WlanSoftmacBridgeStartResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
sme_channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.sme_channel, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
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<WlanSoftmacIfcBaseReportTxResultRequest, D>
for &WlanSoftmacIfcBaseReportTxResultRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
fidl::encoding::Encode::<WlanSoftmacIfcBaseReportTxResultRequest, D>::encode(
(
<fidl_fuchsia_wlan_common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanTxResult, D>,
> fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, 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::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacIfcBaseReportTxResultRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { tx_result: 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.tx_result,
decoder,
offset + 0,
_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 {
24
}
}
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),
<fidl_fuchsia_wlan_common::ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_bandwidth),
<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<fidl_fuchsia_wlan_common::ChannelBandwidth, 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(20);
(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 + 20, 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),
channel_bandwidth: fidl::new_empty!(fidl_fuchsia_wlan_common::ChannelBandwidth, 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(20) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 20 + ((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!(
fidl_fuchsia_wlan_common::ChannelBandwidth,
D,
&mut self.channel_bandwidth,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 20, _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.mac_frame),
<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);
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 {
mac_frame: 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);
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.mac_frame,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl EthernetRxTransferRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.packet_size {
return 2;
}
if let Some(_) = self.packet_address {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for EthernetRxTransferRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for EthernetRxTransferRequest {
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<EthernetRxTransferRequest, D> for &EthernetRxTransferRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EthernetRxTransferRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for EthernetRxTransferRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl EthernetTxTransferRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.complete_borrowed_operation {
return 5;
}
if let Some(_) = self.borrowed_operation {
return 4;
}
if let Some(_) = self.async_id {
return 3;
}
if let Some(_) = self.packet_size {
return 2;
}
if let Some(_) = self.packet_address {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for EthernetTxTransferRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for EthernetTxTransferRequest {
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<EthernetTxTransferRequest, D> for &EthernetTxTransferRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EthernetTxTransferRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.borrowed_operation
.as_ref()
.map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.complete_borrowed_operation
.as_ref()
.map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for EthernetTxTransferRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.borrowed_operation.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.complete_borrowed_operation
.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanAssociationConfig {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.vht_op {
return 12;
}
if let Some(_) = self.vht_cap {
return 11;
}
if let Some(_) = self.ht_op {
return 10;
}
if let Some(_) = self.ht_cap {
return 9;
}
if let Some(_) = self.capability_info {
return 8;
}
if let Some(_) = self.rates {
return 7;
}
if let Some(_) = self.wmm_params {
return 6;
}
if let Some(_) = self.qos {
return 5;
}
if let Some(_) = self.channel {
return 4;
}
if let Some(_) = self.listen_interval {
return 3;
}
if let Some(_) = self.aid {
return 2;
}
if let Some(_) = self.bssid {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanAssociationConfig {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanAssociationConfig {
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<WlanAssociationConfig, D>
for &WlanAssociationConfig
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanAssociationConfig>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
self.bssid
.as_ref()
.map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.aid.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.listen_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanChannel, D>(
self.channel.as_ref().map(<fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.qos.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanWmmParameters, D>(
self.wmm_params.as_ref().map(<fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 263>, D>(
self.rates.as_ref().map(
<fidl::encoding::Vector<u8, 263> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.capability_info.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::HtCapabilities, D>(
self.ht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 10 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (10 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::HtOperation, D>(
self.ht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211::HtOperation as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 11 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (11 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D>(
self.vht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 12 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (12 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::VhtOperation, D>(
self.vht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211::VhtOperation as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAssociationConfig {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.bssid
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.aid.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.listen_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.channel.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_common::WlanChannel, D)
});
fidl::decode!(
fidl_fuchsia_wlan_common::WlanChannel,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.qos.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.wmm_params.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_common::WlanWmmParameters, D)
});
fidl::decode!(
fidl_fuchsia_wlan_common::WlanWmmParameters,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 263> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.rates
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 263>, D));
fidl::decode!(fidl::encoding::Vector<u8, 263>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 8 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.capability_info.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 9 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.ht_cap.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::HtCapabilities, D)
});
fidl::decode!(
fidl_fuchsia_wlan_ieee80211::HtCapabilities,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 10 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_ieee80211::HtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.ht_op.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::HtOperation, D)
});
fidl::decode!(
fidl_fuchsia_wlan_ieee80211::HtOperation,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 11 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.vht_cap.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D)
});
fidl::decode!(
fidl_fuchsia_wlan_ieee80211::VhtCapabilities,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 12 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_ieee80211::VhtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.vht_op.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::VhtOperation, D)
});
fidl::decode!(
fidl_fuchsia_wlan_ieee80211::VhtOperation,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanKeyConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.rsc {
return 8;
}
if let Some(_) = self.key {
return 7;
}
if let Some(_) = self.key_idx {
return 6;
}
if let Some(_) = self.peer_addr {
return 5;
}
if let Some(_) = self.key_type {
return 4;
}
if let Some(_) = self.cipher_type {
return 3;
}
if let Some(_) = self.cipher_oui {
return 2;
}
if let Some(_) = self.protection {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanKeyConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanKeyConfiguration {
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<WlanKeyConfiguration, D>
for &WlanKeyConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanKeyConfiguration>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
self.protection
.as_ref()
.map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
self.cipher_oui
.as_ref()
.map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.cipher_type.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanKeyType, D>(
self.key_type.as_ref().map(<fidl_fuchsia_wlan_common::WlanKeyType as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
self.peer_addr
.as_ref()
.map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
self.key.as_ref().map(
<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfiguration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.cipher_oui
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.cipher_type.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_common::WlanKeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.key_type.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_common::WlanKeyType, D)
});
fidl::decode!(
fidl_fuchsia_wlan_common::WlanKeyType,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.peer_addr
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.key
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 8 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.rsc.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanRxTransferRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.arena {
return 5;
}
if let Some(_) = self.async_id {
return 4;
}
if let Some(_) = self.packet_info {
return 3;
}
if let Some(_) = self.packet_size {
return 2;
}
if let Some(_) = self.packet_address {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanRxTransferRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanRxTransferRequest {
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<WlanRxTransferRequest, D>
for &WlanRxTransferRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanRxTransferRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<WlanRxInfo, D>(
self.packet_info
.as_ref()
.map(<WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxTransferRequest {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<WlanRxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanRxInfo, D));
fidl::decode!(WlanRxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBandCapability {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.operating_channels {
return 11;
}
if let Some(_) = self.basic_rates {
return 10;
}
if let Some(_) = self.operating_channel_list {
return 9;
}
if let Some(_) = self.operating_channel_count {
return 8;
}
if let Some(_) = self.vht_caps {
return 7;
}
if let Some(_) = self.vht_supported {
return 6;
}
if let Some(_) = self.ht_caps {
return 5;
}
if let Some(_) = self.ht_supported {
return 4;
}
if let Some(_) = self.basic_rate_list {
return 3;
}
if let Some(_) = self.basic_rate_count {
return 2;
}
if let Some(_) = self.band {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBandCapability {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBandCapability {
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<WlanSoftmacBandCapability, D> for &WlanSoftmacBandCapability
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBandCapability>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::WlanBand, D>(
self.band.as_ref().map(<fidl_fuchsia_wlan_ieee80211::WlanBand as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.basic_rate_count.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 12>, D>(
self.basic_rate_list.as_ref().map(
<fidl::encoding::Array<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.ht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::HtCapabilities, D>(
self.ht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.vht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D>(
self.vht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.operating_channel_count
.as_ref()
.map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 256>, D>(
self.operating_channel_list.as_ref().map(
<fidl::encoding::Array<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 10 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (10 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 12>, D>(
self.basic_rates.as_ref().map(
<fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 11 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (11 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
self.operating_channels.as_ref().map(
<fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBandCapability
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_ieee80211::WlanBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.band.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::WlanBand, D)
});
fidl::decode!(
fidl_fuchsia_wlan_ieee80211::WlanBand,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.basic_rate_count.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.basic_rate_list
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 12>, D));
fidl::decode!(fidl::encoding::Array<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.ht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.ht_caps.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::HtCapabilities, D)
});
fidl::decode!(
fidl_fuchsia_wlan_ieee80211::HtCapabilities,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.vht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.vht_caps.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D)
});
fidl::decode!(
fidl_fuchsia_wlan_ieee80211::VhtCapabilities,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 8 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.operating_channel_count.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 9 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.operating_channel_list
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 256>, D));
fidl::decode!(fidl::encoding::Array<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 10 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.basic_rates
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D));
fidl::decode!(fidl::encoding::Vector<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 11 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.operating_channels
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBaseCancelScanRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.scan_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseCancelScanRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseCancelScanRequest {
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<WlanSoftmacBaseCancelScanRequest, D>
for &WlanSoftmacBaseCancelScanRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseCancelScanRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseCancelScanRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBaseClearAssociationRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.peer_addr {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseClearAssociationRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseClearAssociationRequest {
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<WlanSoftmacBaseClearAssociationRequest, D>
for &WlanSoftmacBaseClearAssociationRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseClearAssociationRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
self.peer_addr
.as_ref()
.map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseClearAssociationRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.peer_addr
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBaseEnableBeaconingRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.beacon_interval {
return 3;
}
if let Some(_) = self.tim_ele_offset {
return 2;
}
if let Some(_) = self.packet_template {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
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<WlanSoftmacBaseEnableBeaconingRequest, D>
for &WlanSoftmacBaseEnableBeaconingRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseEnableBeaconingRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<WlanTxPacket, D>(
self.packet_template
.as_ref()
.map(<WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.tim_ele_offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.beacon_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseEnableBeaconingRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<WlanTxPacket as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.packet_template.get_or_insert_with(|| fidl::new_empty!(WlanTxPacket, D));
fidl::decode!(WlanTxPacket, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.tim_ele_offset.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.beacon_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBaseSetChannelRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.channel {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseSetChannelRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseSetChannelRequest {
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<WlanSoftmacBaseSetChannelRequest, D>
for &WlanSoftmacBaseSetChannelRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseSetChannelRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanChannel, D>(
self.channel.as_ref().map(<fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseSetChannelRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.channel.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_common::WlanChannel, D)
});
fidl::decode!(
fidl_fuchsia_wlan_common::WlanChannel,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBaseStartPassiveScanRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.min_home_time {
return 4;
}
if let Some(_) = self.max_channel_time {
return 3;
}
if let Some(_) = self.min_channel_time {
return 2;
}
if let Some(_) = self.channels {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
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<WlanSoftmacBaseStartPassiveScanRequest, D>
for &WlanSoftmacBaseStartPassiveScanRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
self.channels.as_ref().map(
<fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i64, D>(
self.min_channel_time
.as_ref()
.map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i64, D>(
self.max_channel_time
.as_ref()
.map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i64, D>(
self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseStartPassiveScanRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.channels
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBaseUpdateWmmParametersRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.params {
return 2;
}
if let Some(_) = self.ac {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
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<WlanSoftmacBaseUpdateWmmParametersRequest, D>
for &WlanSoftmacBaseUpdateWmmParametersRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseUpdateWmmParametersRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::WlanAccessCategory, D>(
self.ac.as_ref().map(<fidl_fuchsia_wlan_ieee80211::WlanAccessCategory as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanWmmParameters, D>(
self.params.as_ref().map(<fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseUpdateWmmParametersRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_ieee80211::WlanAccessCategory as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.ac.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::WlanAccessCategory, D)
});
fidl::decode!(
fidl_fuchsia_wlan_ieee80211::WlanAccessCategory,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.params.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_common::WlanWmmParameters, D)
});
fidl::decode!(
fidl_fuchsia_wlan_common::WlanWmmParameters,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBaseStartActiveScanResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.scan_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartActiveScanResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartActiveScanResponse {
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<WlanSoftmacBaseStartActiveScanResponse, D>
for &WlanSoftmacBaseStartActiveScanResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseStartActiveScanResponse>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseStartActiveScanResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacBaseStartPassiveScanResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.scan_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
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<WlanSoftmacBaseStartPassiveScanResponse, D>
for &WlanSoftmacBaseStartPassiveScanResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanResponse>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacBaseStartPassiveScanResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacIfcBaseNotifyScanCompleteRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.scan_id {
return 2;
}
if let Some(_) = self.status {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
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<WlanSoftmacIfcBaseNotifyScanCompleteRequest, D>
for &WlanSoftmacIfcBaseNotifyScanCompleteRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i32, D>(
self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacIfcBaseNotifyScanCompleteRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacQueryResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.band_caps {
return 5;
}
if let Some(_) = self.hardware_capability {
return 4;
}
if let Some(_) = self.supported_phys {
return 3;
}
if let Some(_) = self.mac_role {
return 2;
}
if let Some(_) = self.sta_addr {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacQueryResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacQueryResponse {
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<WlanSoftmacQueryResponse, D> for &WlanSoftmacQueryResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacQueryResponse>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
self.sta_addr
.as_ref()
.map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanMacRole, D>(
self.mac_role.as_ref().map(<fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D>(
self.supported_phys.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.hardware_capability
.as_ref()
.map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D>(
self.band_caps.as_ref().map(<fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacQueryResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.sta_addr
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.mac_role.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole, D)
});
fidl::decode!(
fidl_fuchsia_wlan_common::WlanMacRole,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Vector<
fidl_fuchsia_wlan_common::WlanPhyType,
64,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.supported_phys.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D));
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.hardware_capability.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.band_caps.get_or_insert_with(
|| fidl::new_empty!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D),
);
fidl::decode!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanSoftmacStartActiveScanRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.max_probes_per_channel {
return 9;
}
if let Some(_) = self.min_probes_per_channel {
return 8;
}
if let Some(_) = self.min_home_time {
return 7;
}
if let Some(_) = self.max_channel_time {
return 6;
}
if let Some(_) = self.min_channel_time {
return 5;
}
if let Some(_) = self.ies {
return 4;
}
if let Some(_) = self.mac_header {
return 3;
}
if let Some(_) = self.ssids {
return 2;
}
if let Some(_) = self.channels {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanSoftmacStartActiveScanRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanSoftmacStartActiveScanRequest {
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<WlanSoftmacStartActiveScanRequest, D>
for &WlanSoftmacStartActiveScanRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanSoftmacStartActiveScanRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
self.channels.as_ref().map(
<fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::CSsid, 84>, D>(
self.ssids.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::CSsid, 84> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 28>, D>(
self.mac_header.as_ref().map(
<fidl::encoding::Vector<u8, 28> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 11454>, D>(
self.ies.as_ref().map(
<fidl::encoding::Vector<u8, 11454> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i64, D>(
self.min_channel_time
.as_ref()
.map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i64, D>(
self.max_channel_time
.as_ref()
.map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i64, D>(
self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.min_probes_per_channel
.as_ref()
.map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.max_probes_per_channel
.as_ref()
.map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlanSoftmacStartActiveScanRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.channels
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Vector<
fidl_fuchsia_wlan_ieee80211::CSsid,
84,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.ssids.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::CSsid, 84>, D));
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::CSsid, 84>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 28> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.mac_header
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 28>, D));
fidl::decode!(fidl::encoding::Vector<u8, 28>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 11454> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.ies
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 11454>, D));
fidl::decode!(fidl::encoding::Vector<u8, 11454>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 8 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.min_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 9 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.max_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl WlanTxTransferRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.arena {
return 5;
}
if let Some(_) = self.async_id {
return 4;
}
if let Some(_) = self.packet_info {
return 3;
}
if let Some(_) = self.packet_size {
return 2;
}
if let Some(_) = self.packet_address {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for WlanTxTransferRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanTxTransferRequest {
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<WlanTxTransferRequest, D>
for &WlanTxTransferRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanTxTransferRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<WlanTxInfo, D>(
self.packet_info
.as_ref()
.map(<WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxTransferRequest {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<WlanTxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanTxInfo, D));
fidl::decode!(WlanTxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
}