netlit 0.1.2

Express literal IP addresses and socket addresses directly in code
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented2 out of 2 items with examples
  • Size
  • Source code size: 8.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 258.93 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • aatifsyed/netlit
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • aatifsyed

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)
};