Crates.io | mac_address2 |
lib.rs | mac_address2 |
version | 2.0.2 |
source | src |
created_at | 2023-04-21 06:35:50.213448 |
updated_at | 2024-03-10 08:04:52.75643 |
description | Cross-platform retrieval of a network interface MAC address. |
homepage | |
repository | https://github.com/Berrysoft/mac_address |
max_upload_size | |
id | 845097 |
size | 38,819 |
mac_address2
mac_address2
provides a cross-platform way to retrieve the MAC address of network hardware.
Supported platforms: Linux, Windows, macOS, FreeBSD, OpenBSD, Android
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),
}
}
mac_address2
is licensed under both MIT and Apache 2.0