Commit Graph
3 Commits
Author SHA1 Message Date
Wez Furlong 98091b688d cidr-map: add CidrMap type
Unfortunately, the upstream bitstring-trees crate didn't expose
a way to query the tree (only iterate it), so I pulled in a copy
of the implementation and adjusted it for that purpose, removing
some unsafe code that replaced values during insertion (for performance)
with a simpler implementation that clones values instead.

With the map implementation in the crate, I adjusted the set
implementation to be a `CidrMap<()>` and dropped the bitstring-trees
dependency.
2023-03-12 10:59:57 -07:00
Wez Furlong 6304ee18c3 improve cidrset data structure
Improve the big-O cost of finding an entry by storing
the ranges in a compressed radix tree under the covers.

Make it a bit easier to work with the type in code while
we're in here.

"any" is now a possible value for cidrsets, representing
any value.
2023-03-12 09:21:56 -07:00
Wez Furlong 6477fc8a25 refactor: move CidrSet to its own crate 2023-03-12 06:46:54 -07:00