19 releases (stable)

1.1.8 Feb 10, 2025
1.1.7 May 22, 2024
1.1.6 Apr 16, 2024
1.1.5 May 25, 2023
0.8.0 Jul 21, 2018

#282 in Network programming

Download history 37069/week @ 2024-12-08 39439/week @ 2024-12-15 34481/week @ 2024-12-22 35594/week @ 2024-12-29 33548/week @ 2025-01-05 33164/week @ 2025-01-12 37554/week @ 2025-01-19 39024/week @ 2025-01-26 47261/week @ 2025-02-02 55956/week @ 2025-02-09 49210/week @ 2025-02-16 53810/week @ 2025-02-23 55968/week @ 2025-03-02 55374/week @ 2025-03-09 59676/week @ 2025-03-16 48086/week @ 2025-03-23

225,521 downloads per month
Used in 188 crates (70 directly)

MIT/Apache

25KB
540 lines

mac_address

crates.io Released API docs

mac_address provides a cross platform way to retrieve the MAC address of network hardware.

Supported platforms: Linux, Windows, MacOS, FreeBSD, OpenBSD, illumos

Example

use mac_address::get_mac_address;

fn main() {
    match get_mac_address() {
        Ok(Some(ma)) => {
            println!("MAC addr = {}", ma);
            println!("bytes = {:?}", ma.bytes());
        }
        Ok(None) => println!("No MAC address found."),
        Err(e) => println!("{:?}", e),
    }
}

License

mac_address is licensed under both MIT and Apache 2.0


lib.rs:

mac_address provides a cross platform way to retrieve the MAC address of network hardware. See the Wikipedia entry for more information.

Supported platforms: Linux, Windows, MacOS, FreeBSD, NetBSD

Dependencies

~0–710KB
~12K SLoC