4 stable releases

2.0.2 Mar 10, 2024
2.0.1 Jun 15, 2023
2.0.0 Apr 28, 2023
1.1.5 Apr 21, 2023

#534 in Network programming

Download history 82/week @ 2023-12-21 166/week @ 2023-12-28 116/week @ 2024-01-04 269/week @ 2024-01-11 475/week @ 2024-01-18 221/week @ 2024-01-25 330/week @ 2024-02-01 203/week @ 2024-02-08 163/week @ 2024-02-15 354/week @ 2024-02-22 417/week @ 2024-02-29 533/week @ 2024-03-07 217/week @ 2024-03-14 465/week @ 2024-03-21 315/week @ 2024-03-28 274/week @ 2024-04-04

1,300 downloads per month

MIT/Apache

19KB
387 lines

mac_address2

crates.io Released API docs

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

Supported platforms: Linux, Windows, macOS, FreeBSD, OpenBSD, Android

Example

use mac_address2::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_address2 is licensed under both MIT and Apache 2.0


lib.rs:

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

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

Dependencies

~0.3–11MB
~101K SLoC