cidr-radix 11.2.0

Zero-dependency, zero-allocation IPv4/IPv6 CIDR parsing, bitmask matching, canonicalization, and radix-indexed IpCidrSet lookup.
Documentation
1
2
3
4
5
6
7
8
9
10
/// Canonical IPv6 CIDR block backed by precomputed 128-bit masks for branchless matching.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Ipv6Cidr {
    /// Canonical masked network address in host byte order.
    pub(crate) network: u128,
    /// Precomputed bitmask (`0` for `/0`, `!0u128 << (128 - prefix_len)` otherwise).
    pub(crate) mask: u128,
    /// Prefix length in `0..=128`.
    pub(crate) prefix_len: u8,
}