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

#671 in Network programming

Download history 327/week @ 2024-01-22 314/week @ 2024-01-29 243/week @ 2024-02-05 174/week @ 2024-02-12 254/week @ 2024-02-19 394/week @ 2024-02-26 553/week @ 2024-03-04 316/week @ 2024-03-11 327/week @ 2024-03-18 324/week @ 2024-03-25 392/week @ 2024-04-01 184/week @ 2024-04-08 378/week @ 2024-04-15 318/week @ 2024-04-22 135/week @ 2024-04-29 313/week @ 2024-05-06

1,147 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–10MB
~98K SLoC