#![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 type MacAddr = [u8; 6];
pub type Ssid = Vec<u8>;
pub const CCMP_128_MIC_LEN: u32 = 8;
pub const CCMP_256_MIC_LEN: u32 = 16;
pub const CCMP_HDR_LEN: u32 = 8;
pub const CCMP_PN_LEN: u32 = 6;
pub const HT_CAP_LEN: u8 = 26;
pub const HT_OP_LEN: u8 = 22;
pub const MAC_ADDR_LEN: u8 = 6;
pub const MAX_KEY_LEN: u8 = 32;
pub const MAX_MESH_ID_BYTE_LEN: u8 = 32;
pub const MAX_MGMT_FRAME_MAC_HEADER_BYTE_LEN: u8 = 28;
pub const MAX_MMPDU_BYTE_LEN: u16 = 2304;
pub const MAX_SSID_BYTE_LEN: u8 = 32;
pub const MAX_SUPPORTED_BASIC_RATES: u8 = 12;
pub const MAX_UNIQUE_CHANNEL_NUMBERS: u16 = 256;
pub const MAX_VHT_MPDU_BYTE_LEN_0: u16 = 3895;
pub const MAX_VHT_MPDU_BYTE_LEN_1: u16 = 7991;
pub const MAX_VHT_MPDU_BYTE_LEN_2: u16 = 11454;
pub const OUI_LEN: u8 = 3;
pub const SSID_LIST_MAX: u8 = 84;
pub const TIDS_MAX: u32 = 16;
pub const VHT_CAP_LEN: u8 = 12;
pub const VHT_OP_LEN: u8 = 5;
pub const WLAN_IE_BODY_MAX_LEN: u32 = 255;
pub const WLAN_IE_MAX_LEN: u32 = 257;
pub const WLAN_MSDU_MAX_LEN: u32 = 2304;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum CipherSuiteType {
UseGroup,
Wep40,
Tkip,
Reserved3,
Ccmp128,
Wep104,
BipCmac128,
GroupAddressedNotAllowed,
Gcmp128,
Gcmp256,
Ccmp256,
BipGmac128,
BipGmac256,
BipCmac256,
Reserved14To255,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! CipherSuiteTypeUnknown {
() => {
_
};
}
impl CipherSuiteType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::UseGroup),
1 => Some(Self::Wep40),
2 => Some(Self::Tkip),
3 => Some(Self::Reserved3),
4 => Some(Self::Ccmp128),
5 => Some(Self::Wep104),
6 => Some(Self::BipCmac128),
7 => Some(Self::GroupAddressedNotAllowed),
8 => Some(Self::Gcmp128),
9 => Some(Self::Gcmp256),
10 => Some(Self::Ccmp256),
11 => Some(Self::BipGmac128),
12 => Some(Self::BipGmac256),
13 => Some(Self::BipCmac256),
14 => Some(Self::Reserved14To255),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
0 => Self::UseGroup,
1 => Self::Wep40,
2 => Self::Tkip,
3 => Self::Reserved3,
4 => Self::Ccmp128,
5 => Self::Wep104,
6 => Self::BipCmac128,
7 => Self::GroupAddressedNotAllowed,
8 => Self::Gcmp128,
9 => Self::Gcmp256,
10 => Self::Ccmp256,
11 => Self::BipGmac128,
12 => Self::BipGmac256,
13 => Self::BipCmac256,
14 => Self::Reserved14To255,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::UseGroup => 0,
Self::Wep40 => 1,
Self::Tkip => 2,
Self::Reserved3 => 3,
Self::Ccmp128 => 4,
Self::Wep104 => 5,
Self::BipCmac128 => 6,
Self::GroupAddressedNotAllowed => 7,
Self::Gcmp128 => 8,
Self::Gcmp256 => 9,
Self::Ccmp256 => 10,
Self::BipGmac128 => 11,
Self::BipGmac256 => 12,
Self::BipCmac256 => 13,
Self::Reserved14To255 => 14,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ReasonCode {
UnspecifiedReason,
InvalidAuthentication,
LeavingNetworkDeauth,
ReasonInactivity,
NoMoreStas,
InvalidClass2Frame,
InvalidClass3Frame,
LeavingNetworkDisassoc,
NotAuthenticated,
UnacceptablePowerCapability,
UnacceptableSupportedChannels,
BssTransitionDisassoc,
ReasonInvalidElement,
MicFailure,
FourwayHandshakeTimeout,
GkHandshakeTimeout,
HandshakeElementMismatch,
ReasonInvalidGroupCipher,
ReasonInvalidPairwiseCipher,
ReasonInvalidAkmp,
UnsupportedRsneVersion,
InvalidRsneCapabilities,
Ieee8021XAuthFailed,
ReasonCipherOutOfPolicy,
TdlsPeerUnreachable,
TdlsUnspecifiedReason,
SspRequestedDisassoc,
NoSspRoamingAgreement,
BadCipherOrAkm,
NotAuthorizedThisLocation,
ServiceChangePrecludesTs,
UnspecifiedQosReason,
NotEnoughBandwidth,
MissingAcks,
ExceededTxop,
StaLeaving,
EndTsBaDls,
UnknownTsBa,
Timeout,
PeerkeyMismatch,
PeerInitiated,
ApInitiated,
ReasonInvalidFtActionFrameCount,
ReasonInvalidPmkid,
ReasonInvalidMde,
ReasonInvalidFte,
MeshPeeringCanceled,
MeshMaxPeers,
MeshConfigurationPolicyViolation,
MeshCloseRcvd,
MeshMaxRetries,
MeshConfirmTimeout,
MeshInvalidGtk,
MeshInconsistentParameters,
MeshInvalidSecurityCapability,
MeshPathErrorNoProxyInformation,
MeshPathErrorNoForwardingInformation,
MeshPathErrorDestinationUnreachable,
MacAddressAlreadyExistsInMbss,
MeshChannelSwitchRegulatoryRequirements,
MeshChannelSwitchUnspecified,
MlmeLinkFailed,
FwRxStalled,
FwHighWmeRxErrRate,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u16,
},
}
#[macro_export]
macro_rules! ReasonCodeUnknown {
() => {
_
};
}
impl ReasonCode {
#[inline]
pub fn from_primitive(prim: u16) -> Option<Self> {
match prim {
1 => Some(Self::UnspecifiedReason),
2 => Some(Self::InvalidAuthentication),
3 => Some(Self::LeavingNetworkDeauth),
4 => Some(Self::ReasonInactivity),
5 => Some(Self::NoMoreStas),
6 => Some(Self::InvalidClass2Frame),
7 => Some(Self::InvalidClass3Frame),
8 => Some(Self::LeavingNetworkDisassoc),
9 => Some(Self::NotAuthenticated),
10 => Some(Self::UnacceptablePowerCapability),
11 => Some(Self::UnacceptableSupportedChannels),
12 => Some(Self::BssTransitionDisassoc),
13 => Some(Self::ReasonInvalidElement),
14 => Some(Self::MicFailure),
15 => Some(Self::FourwayHandshakeTimeout),
16 => Some(Self::GkHandshakeTimeout),
17 => Some(Self::HandshakeElementMismatch),
18 => Some(Self::ReasonInvalidGroupCipher),
19 => Some(Self::ReasonInvalidPairwiseCipher),
20 => Some(Self::ReasonInvalidAkmp),
21 => Some(Self::UnsupportedRsneVersion),
22 => Some(Self::InvalidRsneCapabilities),
23 => Some(Self::Ieee8021XAuthFailed),
24 => Some(Self::ReasonCipherOutOfPolicy),
25 => Some(Self::TdlsPeerUnreachable),
26 => Some(Self::TdlsUnspecifiedReason),
27 => Some(Self::SspRequestedDisassoc),
28 => Some(Self::NoSspRoamingAgreement),
29 => Some(Self::BadCipherOrAkm),
30 => Some(Self::NotAuthorizedThisLocation),
31 => Some(Self::ServiceChangePrecludesTs),
32 => Some(Self::UnspecifiedQosReason),
33 => Some(Self::NotEnoughBandwidth),
34 => Some(Self::MissingAcks),
35 => Some(Self::ExceededTxop),
36 => Some(Self::StaLeaving),
37 => Some(Self::EndTsBaDls),
38 => Some(Self::UnknownTsBa),
39 => Some(Self::Timeout),
45 => Some(Self::PeerkeyMismatch),
46 => Some(Self::PeerInitiated),
47 => Some(Self::ApInitiated),
48 => Some(Self::ReasonInvalidFtActionFrameCount),
49 => Some(Self::ReasonInvalidPmkid),
50 => Some(Self::ReasonInvalidMde),
51 => Some(Self::ReasonInvalidFte),
52 => Some(Self::MeshPeeringCanceled),
53 => Some(Self::MeshMaxPeers),
54 => Some(Self::MeshConfigurationPolicyViolation),
55 => Some(Self::MeshCloseRcvd),
56 => Some(Self::MeshMaxRetries),
57 => Some(Self::MeshConfirmTimeout),
58 => Some(Self::MeshInvalidGtk),
59 => Some(Self::MeshInconsistentParameters),
60 => Some(Self::MeshInvalidSecurityCapability),
61 => Some(Self::MeshPathErrorNoProxyInformation),
62 => Some(Self::MeshPathErrorNoForwardingInformation),
63 => Some(Self::MeshPathErrorDestinationUnreachable),
64 => Some(Self::MacAddressAlreadyExistsInMbss),
65 => Some(Self::MeshChannelSwitchRegulatoryRequirements),
66 => Some(Self::MeshChannelSwitchUnspecified),
128 => Some(Self::MlmeLinkFailed),
129 => Some(Self::FwRxStalled),
130 => Some(Self::FwHighWmeRxErrRate),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u16) -> Self {
match prim {
1 => Self::UnspecifiedReason,
2 => Self::InvalidAuthentication,
3 => Self::LeavingNetworkDeauth,
4 => Self::ReasonInactivity,
5 => Self::NoMoreStas,
6 => Self::InvalidClass2Frame,
7 => Self::InvalidClass3Frame,
8 => Self::LeavingNetworkDisassoc,
9 => Self::NotAuthenticated,
10 => Self::UnacceptablePowerCapability,
11 => Self::UnacceptableSupportedChannels,
12 => Self::BssTransitionDisassoc,
13 => Self::ReasonInvalidElement,
14 => Self::MicFailure,
15 => Self::FourwayHandshakeTimeout,
16 => Self::GkHandshakeTimeout,
17 => Self::HandshakeElementMismatch,
18 => Self::ReasonInvalidGroupCipher,
19 => Self::ReasonInvalidPairwiseCipher,
20 => Self::ReasonInvalidAkmp,
21 => Self::UnsupportedRsneVersion,
22 => Self::InvalidRsneCapabilities,
23 => Self::Ieee8021XAuthFailed,
24 => Self::ReasonCipherOutOfPolicy,
25 => Self::TdlsPeerUnreachable,
26 => Self::TdlsUnspecifiedReason,
27 => Self::SspRequestedDisassoc,
28 => Self::NoSspRoamingAgreement,
29 => Self::BadCipherOrAkm,
30 => Self::NotAuthorizedThisLocation,
31 => Self::ServiceChangePrecludesTs,
32 => Self::UnspecifiedQosReason,
33 => Self::NotEnoughBandwidth,
34 => Self::MissingAcks,
35 => Self::ExceededTxop,
36 => Self::StaLeaving,
37 => Self::EndTsBaDls,
38 => Self::UnknownTsBa,
39 => Self::Timeout,
45 => Self::PeerkeyMismatch,
46 => Self::PeerInitiated,
47 => Self::ApInitiated,
48 => Self::ReasonInvalidFtActionFrameCount,
49 => Self::ReasonInvalidPmkid,
50 => Self::ReasonInvalidMde,
51 => Self::ReasonInvalidFte,
52 => Self::MeshPeeringCanceled,
53 => Self::MeshMaxPeers,
54 => Self::MeshConfigurationPolicyViolation,
55 => Self::MeshCloseRcvd,
56 => Self::MeshMaxRetries,
57 => Self::MeshConfirmTimeout,
58 => Self::MeshInvalidGtk,
59 => Self::MeshInconsistentParameters,
60 => Self::MeshInvalidSecurityCapability,
61 => Self::MeshPathErrorNoProxyInformation,
62 => Self::MeshPathErrorNoForwardingInformation,
63 => Self::MeshPathErrorDestinationUnreachable,
64 => Self::MacAddressAlreadyExistsInMbss,
65 => Self::MeshChannelSwitchRegulatoryRequirements,
66 => Self::MeshChannelSwitchUnspecified,
128 => Self::MlmeLinkFailed,
129 => Self::FwRxStalled,
130 => Self::FwHighWmeRxErrRate,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffff }
}
#[inline]
pub const fn into_primitive(self) -> u16 {
match self {
Self::UnspecifiedReason => 1,
Self::InvalidAuthentication => 2,
Self::LeavingNetworkDeauth => 3,
Self::ReasonInactivity => 4,
Self::NoMoreStas => 5,
Self::InvalidClass2Frame => 6,
Self::InvalidClass3Frame => 7,
Self::LeavingNetworkDisassoc => 8,
Self::NotAuthenticated => 9,
Self::UnacceptablePowerCapability => 10,
Self::UnacceptableSupportedChannels => 11,
Self::BssTransitionDisassoc => 12,
Self::ReasonInvalidElement => 13,
Self::MicFailure => 14,
Self::FourwayHandshakeTimeout => 15,
Self::GkHandshakeTimeout => 16,
Self::HandshakeElementMismatch => 17,
Self::ReasonInvalidGroupCipher => 18,
Self::ReasonInvalidPairwiseCipher => 19,
Self::ReasonInvalidAkmp => 20,
Self::UnsupportedRsneVersion => 21,
Self::InvalidRsneCapabilities => 22,
Self::Ieee8021XAuthFailed => 23,
Self::ReasonCipherOutOfPolicy => 24,
Self::TdlsPeerUnreachable => 25,
Self::TdlsUnspecifiedReason => 26,
Self::SspRequestedDisassoc => 27,
Self::NoSspRoamingAgreement => 28,
Self::BadCipherOrAkm => 29,
Self::NotAuthorizedThisLocation => 30,
Self::ServiceChangePrecludesTs => 31,
Self::UnspecifiedQosReason => 32,
Self::NotEnoughBandwidth => 33,
Self::MissingAcks => 34,
Self::ExceededTxop => 35,
Self::StaLeaving => 36,
Self::EndTsBaDls => 37,
Self::UnknownTsBa => 38,
Self::Timeout => 39,
Self::PeerkeyMismatch => 45,
Self::PeerInitiated => 46,
Self::ApInitiated => 47,
Self::ReasonInvalidFtActionFrameCount => 48,
Self::ReasonInvalidPmkid => 49,
Self::ReasonInvalidMde => 50,
Self::ReasonInvalidFte => 51,
Self::MeshPeeringCanceled => 52,
Self::MeshMaxPeers => 53,
Self::MeshConfigurationPolicyViolation => 54,
Self::MeshCloseRcvd => 55,
Self::MeshMaxRetries => 56,
Self::MeshConfirmTimeout => 57,
Self::MeshInvalidGtk => 58,
Self::MeshInconsistentParameters => 59,
Self::MeshInvalidSecurityCapability => 60,
Self::MeshPathErrorNoProxyInformation => 61,
Self::MeshPathErrorNoForwardingInformation => 62,
Self::MeshPathErrorDestinationUnreachable => 63,
Self::MacAddressAlreadyExistsInMbss => 64,
Self::MeshChannelSwitchRegulatoryRequirements => 65,
Self::MeshChannelSwitchUnspecified => 66,
Self::MlmeLinkFailed => 128,
Self::FwRxStalled => 129,
Self::FwHighWmeRxErrRate => 130,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u16)]
pub enum StatusCode {
Success = 0,
RefusedReasonUnspecified = 1,
TdlsRejectedAlternativeProvided = 2,
TdlsRejected = 3,
SecurityDisabled = 5,
UnacceptableLifetime = 6,
NotInSameBss = 7,
RefusedCapabilitiesMismatch = 10,
DeniedNoAssociationExists = 11,
DeniedOtherReason = 12,
UnsupportedAuthAlgorithm = 13,
TransactionSequenceError = 14,
ChallengeFailure = 15,
RejectedSequenceTimeout = 16,
DeniedNoMoreStas = 17,
RefusedBasicRatesMismatch = 18,
DeniedNoShortPreambleSupport = 19,
RejectedSpectrumManagementRequired = 22,
RejectedBadPowerCapability = 23,
RejectedBadSupportedChannels = 24,
DeniedNoShortSlotTimeSupport = 25,
DeniedNoHtSupport = 27,
R0KhUnreachable = 28,
DeniedPcoTimeNotSupported = 29,
RefusedTemporarily = 30,
RobustManagementPolicyViolation = 31,
UnspecifiedQosFailure = 32,
DeniedInsufficientBandwidth = 33,
DeniedPoorChannelConditions = 34,
DeniedQosNotSupported = 35,
RequestDeclined = 37,
InvalidParameters = 38,
RejectedWithSuggestedChanges = 39,
StatusInvalidElement = 40,
StatusInvalidGroupCipher = 41,
StatusInvalidPairwiseCipher = 42,
StatusInvalidAkmp = 43,
UnsupportedRsneVersion = 44,
InvalidRsneCapabilities = 45,
StatusCipherOutOfPolicy = 46,
RejectedForDelayPeriod = 47,
DlsNotAllowed = 48,
NotPresent = 49,
NotQosSta = 50,
DeniedListenIntervalTooLarge = 51,
StatusInvalidFtActionFrameCount = 52,
StatusInvalidPmkid = 53,
StatusInvalidMde = 54,
StatusInvalidFte = 55,
RequestedTclasNotSupportedByAp = 56,
InsufficientTclasProcessingResources = 57,
TryAnotherBss = 58,
GasAdvertisementProtocolNotSupported = 59,
NoOutstandingGasRequest = 60,
GasResponseNotReceivedFromServer = 61,
GasQueryTimeout = 62,
GasQueryResponseTooLarge = 63,
RejectedHomeWithSuggestedChanges = 64,
ServerUnreachable = 65,
RejectedForSspPermissions = 67,
RefusedUnauthenticatedAccessNotSupported = 68,
InvalidRsne = 72,
UApsdCoexistanceNotSupported = 73,
UApsdCoexModeNotSupported = 74,
BadIntervalWithUApsdCoex = 75,
AntiCloggingTokenRequired = 76,
UnsupportedFiniteCyclicGroup = 77,
CannotFindAlternativeTbtt = 78,
TransmissionFailure = 79,
RequestedTclasNotSupported = 80,
TclasResourcesExhausted = 81,
RejectedWithSuggestedBssTransition = 82,
RejectWithSchedule = 83,
RejectNoWakeupSpecified = 84,
SuccessPowerSaveMode = 85,
PendingAdmittingFstSession = 86,
PerformingFstNow = 87,
PendingGapInBaWindow = 88,
RejectUPidSetting = 89,
RefusedExternalReason = 92,
RefusedApOutOfMemory = 93,
RejectedEmergencyServicesNotSupported = 94,
QueryResponseOutstanding = 95,
RejectDseBand = 96,
TclasProcessingTerminated = 97,
TsScheduleConflict = 98,
DeniedWithSuggestedBandAndChannel = 99,
MccaopReservationConflict = 100,
MafLimitExceeded = 101,
MccaTrackLimitExceeded = 102,
DeniedDueToSpectrumManagement = 103,
DeniedVhtNotSupported = 104,
EnablementDenied = 105,
RestrictionFromAuthorizedGdb = 106,
AuthorizationDeenabled = 107,
JoinFailure = 256,
SpuriousDeauthOrDisassoc = 257,
Canceled = 258,
EstablishRsnaFailure = 259,
}
impl StatusCode {
#[inline]
pub fn from_primitive(prim: u16) -> Option<Self> {
match prim {
0 => Some(Self::Success),
1 => Some(Self::RefusedReasonUnspecified),
2 => Some(Self::TdlsRejectedAlternativeProvided),
3 => Some(Self::TdlsRejected),
5 => Some(Self::SecurityDisabled),
6 => Some(Self::UnacceptableLifetime),
7 => Some(Self::NotInSameBss),
10 => Some(Self::RefusedCapabilitiesMismatch),
11 => Some(Self::DeniedNoAssociationExists),
12 => Some(Self::DeniedOtherReason),
13 => Some(Self::UnsupportedAuthAlgorithm),
14 => Some(Self::TransactionSequenceError),
15 => Some(Self::ChallengeFailure),
16 => Some(Self::RejectedSequenceTimeout),
17 => Some(Self::DeniedNoMoreStas),
18 => Some(Self::RefusedBasicRatesMismatch),
19 => Some(Self::DeniedNoShortPreambleSupport),
22 => Some(Self::RejectedSpectrumManagementRequired),
23 => Some(Self::RejectedBadPowerCapability),
24 => Some(Self::RejectedBadSupportedChannels),
25 => Some(Self::DeniedNoShortSlotTimeSupport),
27 => Some(Self::DeniedNoHtSupport),
28 => Some(Self::R0KhUnreachable),
29 => Some(Self::DeniedPcoTimeNotSupported),
30 => Some(Self::RefusedTemporarily),
31 => Some(Self::RobustManagementPolicyViolation),
32 => Some(Self::UnspecifiedQosFailure),
33 => Some(Self::DeniedInsufficientBandwidth),
34 => Some(Self::DeniedPoorChannelConditions),
35 => Some(Self::DeniedQosNotSupported),
37 => Some(Self::RequestDeclined),
38 => Some(Self::InvalidParameters),
39 => Some(Self::RejectedWithSuggestedChanges),
40 => Some(Self::StatusInvalidElement),
41 => Some(Self::StatusInvalidGroupCipher),
42 => Some(Self::StatusInvalidPairwiseCipher),
43 => Some(Self::StatusInvalidAkmp),
44 => Some(Self::UnsupportedRsneVersion),
45 => Some(Self::InvalidRsneCapabilities),
46 => Some(Self::StatusCipherOutOfPolicy),
47 => Some(Self::RejectedForDelayPeriod),
48 => Some(Self::DlsNotAllowed),
49 => Some(Self::NotPresent),
50 => Some(Self::NotQosSta),
51 => Some(Self::DeniedListenIntervalTooLarge),
52 => Some(Self::StatusInvalidFtActionFrameCount),
53 => Some(Self::StatusInvalidPmkid),
54 => Some(Self::StatusInvalidMde),
55 => Some(Self::StatusInvalidFte),
56 => Some(Self::RequestedTclasNotSupportedByAp),
57 => Some(Self::InsufficientTclasProcessingResources),
58 => Some(Self::TryAnotherBss),
59 => Some(Self::GasAdvertisementProtocolNotSupported),
60 => Some(Self::NoOutstandingGasRequest),
61 => Some(Self::GasResponseNotReceivedFromServer),
62 => Some(Self::GasQueryTimeout),
63 => Some(Self::GasQueryResponseTooLarge),
64 => Some(Self::RejectedHomeWithSuggestedChanges),
65 => Some(Self::ServerUnreachable),
67 => Some(Self::RejectedForSspPermissions),
68 => Some(Self::RefusedUnauthenticatedAccessNotSupported),
72 => Some(Self::InvalidRsne),
73 => Some(Self::UApsdCoexistanceNotSupported),
74 => Some(Self::UApsdCoexModeNotSupported),
75 => Some(Self::BadIntervalWithUApsdCoex),
76 => Some(Self::AntiCloggingTokenRequired),
77 => Some(Self::UnsupportedFiniteCyclicGroup),
78 => Some(Self::CannotFindAlternativeTbtt),
79 => Some(Self::TransmissionFailure),
80 => Some(Self::RequestedTclasNotSupported),
81 => Some(Self::TclasResourcesExhausted),
82 => Some(Self::RejectedWithSuggestedBssTransition),
83 => Some(Self::RejectWithSchedule),
84 => Some(Self::RejectNoWakeupSpecified),
85 => Some(Self::SuccessPowerSaveMode),
86 => Some(Self::PendingAdmittingFstSession),
87 => Some(Self::PerformingFstNow),
88 => Some(Self::PendingGapInBaWindow),
89 => Some(Self::RejectUPidSetting),
92 => Some(Self::RefusedExternalReason),
93 => Some(Self::RefusedApOutOfMemory),
94 => Some(Self::RejectedEmergencyServicesNotSupported),
95 => Some(Self::QueryResponseOutstanding),
96 => Some(Self::RejectDseBand),
97 => Some(Self::TclasProcessingTerminated),
98 => Some(Self::TsScheduleConflict),
99 => Some(Self::DeniedWithSuggestedBandAndChannel),
100 => Some(Self::MccaopReservationConflict),
101 => Some(Self::MafLimitExceeded),
102 => Some(Self::MccaTrackLimitExceeded),
103 => Some(Self::DeniedDueToSpectrumManagement),
104 => Some(Self::DeniedVhtNotSupported),
105 => Some(Self::EnablementDenied),
106 => Some(Self::RestrictionFromAuthorizedGdb),
107 => Some(Self::AuthorizationDeenabled),
256 => Some(Self::JoinFailure),
257 => Some(Self::SpuriousDeauthOrDisassoc),
258 => Some(Self::Canceled),
259 => Some(Self::EstablishRsnaFailure),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u16 {
self as u16
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum WlanAccessCategory {
Background = 1,
BestEffort = 2,
Video = 3,
Voice = 4,
}
impl WlanAccessCategory {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Background),
2 => Some(Self::BestEffort),
3 => Some(Self::Video),
4 => Some(Self::Voice),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum WlanBand {
TwoGhz,
FiveGhz,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u8,
},
}
#[macro_export]
macro_rules! WlanBandUnknown {
() => {
_
};
}
impl WlanBand {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::TwoGhz),
1 => Some(Self::FiveGhz),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u8) -> Self {
match prim {
0 => Self::TwoGhz,
1 => Self::FiveGhz,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xff }
}
#[inline]
pub const fn into_primitive(self) -> u8 {
match self {
Self::TwoGhz => 0,
Self::FiveGhz => 1,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CSsid {
pub len: u8,
pub data: [u8; 32],
}
impl fidl::Persistable for CSsid {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct HtCapabilities {
pub bytes: [u8; 26],
}
impl fidl::Persistable for HtCapabilities {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct HtOperation {
pub bytes: [u8; 22],
}
impl fidl::Persistable for HtOperation {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VhtCapabilities {
pub bytes: [u8; 12],
}
impl fidl::Persistable for VhtCapabilities {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VhtOperation {
pub bytes: [u8; 5],
}
impl fidl::Persistable for VhtOperation {}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for CipherSuiteType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for CipherSuiteType {
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 CipherSuiteType
{
#[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 CipherSuiteType {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ReasonCode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u16>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u16>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ReasonCode {
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 ReasonCode {
#[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 ReasonCode {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u16>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StatusCode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u16>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u16>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for StatusCode {
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 StatusCode {
#[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 StatusCode {
#[inline(always)]
fn new_empty() -> Self {
Self::Success
}
#[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::<u16>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WlanAccessCategory {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for WlanAccessCategory {
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 WlanAccessCategory
{
#[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 WlanAccessCategory {
#[inline(always)]
fn new_empty() -> Self {
Self::Background
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WlanBand {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for WlanBand {
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 WlanBand {
#[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 WlanBand {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CSsid {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CSsid {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
33
}
#[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<CSsid, D> for &CSsid {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CSsid>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CSsid).write_unaligned((self as *const CSsid).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u8, D>,
T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>, D>,
> fidl::encoding::Encode<CSsid, 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::<CSsid>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CSsid {
#[inline(always)]
fn new_empty() -> Self {
Self {
len: fidl::new_empty!(u8, D),
data: fidl::new_empty!(fidl::encoding::Array<u8, 32>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 33);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for HtCapabilities {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for HtCapabilities {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
26
}
#[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<HtCapabilities, D>
for &HtCapabilities
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<HtCapabilities>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut HtCapabilities)
.write_unaligned((self as *const HtCapabilities).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 26>, D>,
> fidl::encoding::Encode<HtCapabilities, 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::<HtCapabilities>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HtCapabilities {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(fidl::encoding::Array<u8, 26>, 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, 26);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for HtOperation {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for HtOperation {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
22
}
#[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<HtOperation, D>
for &HtOperation
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<HtOperation>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut HtOperation).write_unaligned((self as *const HtOperation).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 22>, D>,
> fidl::encoding::Encode<HtOperation, 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::<HtOperation>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HtOperation {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(fidl::encoding::Array<u8, 22>, 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, 22);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VhtCapabilities {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VhtCapabilities {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
#[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<VhtCapabilities, D>
for &VhtCapabilities
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VhtCapabilities>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VhtCapabilities)
.write_unaligned((self as *const VhtCapabilities).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 12>, D>,
> fidl::encoding::Encode<VhtCapabilities, 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::<VhtCapabilities>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VhtCapabilities {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(fidl::encoding::Array<u8, 12>, 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, 12);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VhtOperation {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VhtOperation {
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
}
#[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<VhtOperation, D>
for &VhtOperation
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VhtOperation>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VhtOperation)
.write_unaligned((self as *const VhtOperation).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 5>, D>,
> fidl::encoding::Encode<VhtOperation, 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::<VhtOperation>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VhtOperation {
#[inline(always)]
fn new_empty() -> Self {
Self { bytes: fidl::new_empty!(fidl::encoding::Array<u8, 5>, 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, 5);
}
Ok(())
}
}
}