const-addrs 0.2.0

A set of macros for creating networking types from a string literal.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use macaddr::MacAddr8;

use const_addrs::mac8;

fn main() {
    let a = mac8!("c0:ff:ee:c0:ff:ee:ca:fe");
    assert_eq!(
        a,
        MacAddr8::from([0xc0, 0xff, 0xee, 0xc0, 0xff, 0xee, 0xca, 0xfe])
    );
}