krisprice / ipnet

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

Add new_assert implementations #57

Closed jjanowsk closed 1 week ago

jjanowsk commented 1 month 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.