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
use ipnetwork::Ipv4Network;

use const_addrs::{ip4, net4};

fn main() {
    let a = net4!("192.168.1.1/24");
    assert_eq!(a, Ipv4Network::new(ip4!("192.168.1.1"), 24).unwrap());
}