| Crates.io | netlit |
| lib.rs | netlit |
| version | 0.1.2 |
| created_at | 2025-06-15 11:59:46.07542+00 |
| updated_at | 2025-06-16 22:38:27.280103+00 |
| description | Express literal IP addresses and socket addresses directly in code |
| homepage | https://crates.io/crates/netlit |
| repository | https://github.com/aatifsyed/netlit |
| max_upload_size | |
| id | 1713206 |
| size | 8,156 |
Express Ipv4Addr and SocketAddrV4
directly in code:
assert_eq!(netlit!(127.0.0.1), Ipv4Addr::LOCALHOST);
assert_eq!(netlit!(127.0.0.1:8000), SocketAddrV4::new(Ipv4Addr::LOCALHOST, 8000));
const SUPPORT: SocketAddrV4 = netlit!(127.0.0.1:8000);
assert_eq!(netlit!(::1), Ipv6Addr::LOCALHOST);
assert_eq! {
netlit!([dead:beef::1%30]:8000),
SocketAddrV6::new(Ipv6Addr::new(0xdead, 0xbeef, 0, 0, 0, 0, 0, 1), 8000, 0, 30)
};