ipzone 0.4.0

Ipzone provides a simple and powerful IP architecture to Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use ipzone::prelude::*;

#[test]
fn it_works() {
    let localhost = ip::localhost().with([6060, 8080]);

    assert_eq!(
        localhost.to_socket_addrs().unwrap().collect::<Vec<_>>(),
        vec![
            SocketAddr::new(Ip::V4(Ipv4::new(127, 0, 0, 1)), 6060),
            SocketAddr::new(Ip::V4(Ipv4::new(127, 0, 0, 1)), 8080),
        ]
    );
}