use-mac 0.1.0

MAC address parsing, normalization, and formatting helpers for RustUse.
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented1 out of 9 items with examples
  • Size
  • Source code size: 6.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 340.26 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • RustUse/use-net
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-mac

use-mac provides small helpers for parsing, formatting, and normalizing MAC addresses.

Experimental: this crate is below 0.3.0 and the API may change.

Example Usage

use use_mac::{normalize_mac, parse_mac_address};

let mac = parse_mac_address("00-1A-2B-3C-4D-5E").unwrap();

assert_eq!(normalize_mac("001A2B3C4D5E"), Some("00:1A:2B:3C:4D:5E".to_string()));
assert_eq!(mac.octets, [0x00, 0x1A, 0x2B, 0x3C, 0x4D, 0x5E]);

Scope

  • Parsing common MAC address formats.
  • Formatting helpers for colon and hyphen output.
  • Small helpers for broadcast and zero-address checks.

Non-goals

  • Vendor lookup.
  • Network adapter inspection.
  • Packet parsing.

License

Licensed under MIT OR Apache-2.0.