ipzone

Ipzone provides a simple and powerful IP architecture to Rust.

CI Crates.io Licensed Twitter

| Examples | Docs | Latest Note |

toml ipzone = "0.3.0"

Examples

```rust use ipzone::prelude::*;

let local: Address<3> = ip::localhost([6004, 7040, 8080]); TcpListener::bind(local);

let address: Address<2> = ip::from([168, 159, 42, 9]).with([80, 443]); TcpStream::connect(address);

let local = ip::localhost([port::fromenv("PORT").unwrapor(8080), 7020, 2020]); TcpListener::bind(local);

let address = ip::from([186, 23, 123, 1, 0, 0, 0, 0]).with([80, 443]); TcpStream::connect(address);

let local = ip::localhost([1234, 5678, port::from_str("9090").unwrap()); TcpListener::bind(local);

let address = ip::from_str("168.24.41.123").unwrap().with([80, 443]); TcpStream::connect(address);

let local = ip::from_str("::1").unwrap().with([80, 443]); TcpListener::bind(local);

let address = ip::from_env("IP").unwrap().with(["80", "443"]); TcpStream::connect(address);

static LOCALHOST: Global

= global(|| ip::localhost().with([8080])); ```