krisprice / ipnet

IpNet, Ipv4Net, and Ipv6Net types and methods for Rust
Apache License 2.0
122 stars 26 forks source link

Add new_assert implementations #57

Closed jjanowsk closed 1 month ago

jjanowsk commented 3 months ago

Add new_assert implementations that can verify prefix length at compile time. That allows users to create const items of IpvXNet type. When called not from a const context it will panic at runtime when prefix length is incorrect.