ip_network_table
IPv4 and IPv6 network fast lookup table.
Description
This crate provides storage and retrieval of IPv4 and IPv6 network prefixes.
Currently, it uses ip_network
crate, that provides IP network data structure and fork of
treebitmap
(fork) as backend, that provides fast lookup times, and a small memory footprint. Backend can be changed in future releases.
Usage
Add this to your Cargo.toml
:
[]
= "0.4"
= "0.2"
this to your crate root (not necessary when your project is Rust 2018 edition):
extern crate ip_network;
extern crate ip_network_table;
and then you can use it like this:
use ;
use ;
use IpNetworkTable;
let mut table = new;
let network = new.unwrap;
let ip_address = new;
assert_eq!;
// Get value for network from table
assert_eq!;
Minimal required version of Rust compiler is 1.31 (because of ip_network
crate).