[dependencies]
iprfc = "0.2"iprfc exposes const functions for common RFC address classes, so downstream
crates can reuse the same no-std range checks in constructors and predicates.
use iprfc::{is_documentation_ip_addr, is_private_ip_addr};
let private = "10.0.0.1".parse().unwrap();
assert!(is_private_ip_addr(private));
let documentation = "3fff::1".parse().unwrap();
assert!(is_documentation_ip_addr(documentation));- Reference to: HashiCorp's go-sockaddr
rfc.go
iprfc is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2021 Al Liu.