mac-addr

Lightweight, dependency-free, no_std compatible MAC address library
supporting both EUI-48 (MacAddr) and EUI-64 (MacAddr8).
Overview
It’s designed for portability and low-level use:
- no_std compatible
- Optional
allocfor string formatting - Optional
serdesupport for serialization and deserialization - Small, efficient, and FFI-safe
Usage
Add mac-addr to your dependencies
[]
= "0.3"
Example
use ;
let mac6: MacAddr = "00:25:96:12:34:56".parse.unwrap;
assert_eq!;
// Convert EUI-48 -> EUI-64
let mac8 = from_eui48;
assert_eq!;
// And back
assert_eq!;
For more details, see doc.
Features
| Feature | Default | Description |
|---|---|---|
std |
✅ | Use Rust standard library |
alloc |
⬜ | Enable heap allocation for MacAddr::address() |
serde |
⬜ | Add serde::Serialize / Deserialize implementations |