mac_address

Crates.iomac_address
lib.rsmac_address
version1.1.7
sourcesrc
created_at2018-04-03 23:41:46.502707
updated_at2024-05-22 23:30:59.152796
descriptionCross-platform retrieval of a network interface MAC address.
homepage
repositoryhttps://github.com/rep-nop/mac_address
max_upload_size
id58861
size42,124
Wesley Norris (repnop)

documentation

README

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

Commit count: 64

cargo fmt