mac_address2

Crates.iomac_address2
lib.rsmac_address2
version2.0.2
sourcesrc
created_at2023-04-21 06:35:50.213448
updated_at2024-03-10 08:04:52.75643
descriptionCross-platform retrieval of a network interface MAC address.
homepage
repositoryhttps://github.com/Berrysoft/mac_address
max_upload_size
id845097
size38,819
王宇逸 (Berrysoft)

documentation

README

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

Commit count: 67

cargo fmt