Derive Macro libwifi_macros::AddressHeader[][src]


A little helper derive macro to implement the libwifi::Addresses trait for frames with either a DataHeader or a ManagementHeader.

This macro is only designed for internal usage in the libwifi crate.

How to use:

#[derive(Clone, Debug, AddressHeader)]
pub struct AssociationRequest {
    pub header: ManagementHeader,
    pub beacon_interval: u16,
    pub capability_info: u16,
    pub station_info: StationInfo,

The new generated code will look like this:

impl crate::Addresses for AssociationRequest {
    fn src(&self) -> Option<&MacAddress> {

    fn dest(&self) -> &MacAddress {

    fn bssid(&self) -> Option<&MacAddress> {