proofs.rs

ipnet 2.12.2

proofs.rs claims for ipnet 2.12.2
README badge

Claims in public reports for version 2.12.2.

[![proofs.rs](https://img.shields.io/endpoint?url=https%3A%2F%2Fproofs.rs%2Fapi%2Fv1%2Fcrates%2Fipnet%2F2.12.2%2Fbadge)](https://proofs.rs/crate/ipnet?version=2.12.2)

Provides types and useful methods for working with IPv4 and IPv6 network addresses, commonly called IP prefixes. The new `IpNet`, `Ipv4Net`, and `Ipv6Net` types build on the existing `IpAddr`, `Ipv4Addr`, and `Ipv6Addr` types already provided in Rust's standard library and align to their design to stay consistent. The module also provides useful traits that extend `Ipv4Addr` and `Ipv6Addr` with methods for `Add`, `Sub`, `BitAnd`, and `BitOr` operations. The module only uses stable feature so it is guaranteed to compile using the stable toolchain.

crates.io

Reports (1)

#9 Selected network and iterator behavior in ipnet 2.12.2

Findings (3)

For version 2.12.2. Statuses are author reported.

APIs (313)

APIs are imported from documentation or named in published verification records. 151 have at least one claim; a count says nothing about how strong each claim is.

APIClaims · findings

Functions

pub fn ip_mask_to_prefix(mask: std::net::IpAddr) -> Result<u8, crate::PrefixLenError>1 claim
pub fn ipv4_mask_to_prefix(mask: std::net::Ipv4Addr) -> Result<u8, crate::PrefixLenError>1 claim
pub fn ipv6_mask_to_prefix(mask: std::net::Ipv6Addr) -> Result<u8, crate::PrefixLenError>1 claim

Associated functions

impl IpNet

pub fn aggregate(networks: &Vec<IpNet>) -> Vec<IpNet>—
pub fn new(ip: IpAddr, prefix_len: u8) -> Result<IpNet, PrefixLenError>1 claim
pub const fn new_assert(ip: IpAddr, prefix_len: u8) -> IpNet1 claim
pub fn with_netmask(ip: IpAddr, netmask: IpAddr) -> Result<IpNet, PrefixLenError>1 claim

impl Ipv4AddrRange

pub fn new(start: Ipv4Addr, end: Ipv4Addr) -> Self1 claim

impl Ipv4Net

pub fn aggregate(networks: &Vec<Ipv4Net>) -> Vec<Ipv4Net>—
pub const fn new(ip: Ipv4Addr, prefix_len: u8) -> Result<Ipv4Net, PrefixLenError>1 claim
pub const fn new_assert(ip: Ipv4Addr, prefix_len: u8) -> Ipv4Net1 claim
pub fn with_netmask(ip: Ipv4Addr, netmask: Ipv4Addr) -> Result<Ipv4Net, PrefixLenError>1 claim

impl Ipv4Subnets

pub fn new(start: Ipv4Addr, end: Ipv4Addr, min_prefix_len: u8) -> Self1 claim

impl Ipv6AddrRange

pub fn new(start: Ipv6Addr, end: Ipv6Addr) -> Self1 claim

impl Ipv6Net

pub fn aggregate(networks: &Vec<Ipv6Net>) -> Vec<Ipv6Net>—
pub const fn new(ip: Ipv6Addr, prefix_len: u8) -> Result<Ipv6Net, PrefixLenError>1 claim
pub const fn new_assert(ip: Ipv6Addr, prefix_len: u8) -> Ipv6Net1 claim
pub fn with_netmask(ip: Ipv6Addr, netmask: Ipv6Addr) -> Result<Ipv6Net, PrefixLenError>1 claim

impl Ipv6Subnets

pub fn new(start: Ipv6Addr, end: Ipv6Addr, min_prefix_len: u8) -> Self1 claim

Methods

impl IpNet

pub fn addr(self: &Self) -> IpAddr1 claim
pub fn broadcast(self: &Self) -> IpAddr1 claim
pub fn contains<T>(self: &Self, other: T) -> bool where Self: Contains<T>2 claims
pub fn hostmask(self: &Self) -> IpAddr1 claim
pub fn hosts(self: &Self) -> IpAddrRange2 claims
pub fn is_sibling(self: &Self, other: &IpNet) -> bool4 claims
pub fn max_prefix_len(self: &Self) -> u81 claim
pub fn netmask(self: &Self) -> IpAddr1 claim
pub fn network(self: &Self) -> IpAddr1 claim
pub fn prefix_len(self: &Self) -> u81 claim
pub fn subnets(self: &Self, new_prefix_len: u8) -> Result<IpSubnets, PrefixLenError>2 claims
pub fn supernet(self: &Self) -> Option<IpNet>2 claims
pub fn trunc(self: &Self) -> IpNet1 claim

impl Ipv4Net

pub const fn addr(self: &Self) -> Ipv4Addr1 claim
pub fn broadcast(self: &Self) -> Ipv4Addr1 claim
pub fn contains<T>(self: &Self, other: T) -> bool where Self: Contains<T>2 claims
pub fn hostmask(self: &Self) -> Ipv4Addr1 claim
pub fn hosts(self: &Self) -> Ipv4AddrRange1 claim
pub fn is_sibling(self: &Self, other: &Ipv4Net) -> bool1 claim
pub const fn max_prefix_len(self: &Self) -> u81 claim
pub fn netmask(self: &Self) -> Ipv4Addr1 claim
pub fn network(self: &Self) -> Ipv4Addr1 claim
pub const fn prefix_len(self: &Self) -> u81 claim
pub fn subnets(self: &Self, new_prefix_len: u8) -> Result<Ipv4Subnets, PrefixLenError>1 claim
pub fn supernet(self: &Self) -> Option<Ipv4Net>1 claim
pub fn trunc(self: &Self) -> Ipv4Net1 claim

impl Ipv6Net

pub const fn addr(self: &Self) -> Ipv6Addr1 claim
pub fn broadcast(self: &Self) -> Ipv6Addr1 claim
pub fn contains<T>(self: &Self, other: T) -> bool where Self: Contains<T>2 claims
pub fn hostmask(self: &Self) -> Ipv6Addr1 claim
pub fn hosts(self: &Self) -> Ipv6AddrRange1 claim
pub fn is_sibling(self: &Self, other: &Ipv6Net) -> bool1 claim
pub const fn max_prefix_len(self: &Self) -> u81 claim
pub fn netmask(self: &Self) -> Ipv6Addr1 claim
pub fn network(self: &Self) -> Ipv6Addr1 claim
pub const fn prefix_len(self: &Self) -> u81 claim
pub fn subnets(self: &Self, new_prefix_len: u8) -> Result<Ipv6Subnets, PrefixLenError>1 claim
pub fn supernet(self: &Self) -> Option<Ipv6Net>1 claim
pub fn trunc(self: &Self) -> Ipv6Net1 claim

Traits

trait IpAdd

pub fn saturating_add(self: Self, rhs: RHS) -> <Self as ipnet::ipext::IpAdd>::Output—

trait IpBitAnd

pub fn bitand(self: Self, rhs: RHS) -> <Self as ipnet::ipext::IpBitAnd>::Output—

trait IpBitOr

pub fn bitor(self: Self, rhs: RHS) -> <Self as ipnet::ipext::IpBitOr>::Output—

trait IpSub

pub fn saturating_sub(self: Self, rhs: RHS) -> <Self as ipnet::ipext::IpSub>::Output—

Trait implementations

impl core::clone::Clone for …

fn clone11 implementations11 claims

impl core::cmp::Ord for …

fn cmp9 implementations9 claims

impl core::cmp::PartialEq for …

fn eq11 implementations11 claims

impl core::cmp::PartialOrd for …

fn partial_cmp9 implementations9 claims

impl core::convert::From<core::net::ip_addr::IpAddr> for IpNet

pub fn from(addr: IpAddr) -> IpNet1 claim

impl core::convert::From<core::net::ip_addr::Ipv4Addr> for Ipv4Net

pub fn from(addr: Ipv4Addr) -> Ipv4Net1 claim

impl core::convert::From<core::net::ip_addr::Ipv6Addr> for Ipv6Net

pub fn from(addr: Ipv6Addr) -> Ipv6Net1 claim

impl core::convert::From<ipnet::Ipv4AddrRange> for IpAddrRange

fn from2 implementations1 claim

impl core::convert::From<ipnet::Ipv4Net> for IpNet

fn from2 implementations1 claim

impl core::convert::From<ipnet::Ipv4Subnets> for IpSubnets

fn from2 implementations1 claim

impl core::convert::From<ipnet::Ipv6AddrRange> for IpAddrRange

fn from2 implementations1 claim

impl core::convert::From<ipnet::Ipv6Net> for IpNet

fn from2 implementations1 claim

impl core::convert::From<ipnet::Ipv6Subnets> for IpSubnets

fn from2 implementations1 claim

impl core::default::Default for …

fn default3 implementations3 claims

impl core::fmt::Debug for …

fn fmt11 implementations—

impl core::fmt::Display for …

fn fmt5 implementations—

impl core::hash::Hash for …

fn hash9 implementations—

impl core::iter::traits::double_ended::DoubleEndedIterator for …

fn next_back3 implementations3 claims
fn nth_back3 implementations3 claims

impl core::iter::traits::iterator::Iterator for …

fn count3 implementations3 claims
fn last3 implementations3 claims
fn max3 implementations3 claims
fn min3 implementations3 claims
fn next6 implementations6 claims
fn nth3 implementations3 claims
fn size_hint3 implementations3 claims

impl core::str::traits::FromStr for …

fn from_str3 implementations—

impl ipnet::IpAdd<u128> for core::net::ip_addr::Ipv6Addr

pub fn saturating_add(self: Self, rhs: u128) -> Ipv6Addr1 claim

impl ipnet::IpAdd<u32> for core::net::ip_addr::Ipv4Addr

pub fn saturating_add(self: Self, rhs: u32) -> Ipv4Addr1 claim

impl ipnet::IpBitAnd for …

fn bitand2 implementations2 claims

impl ipnet::IpBitAnd<u128> for core::net::ip_addr::Ipv6Addr

pub fn bitand(self: Self, rhs: u128) -> Ipv6Addr1 claim

impl ipnet::IpBitAnd<u32> for core::net::ip_addr::Ipv4Addr

pub fn bitand(self: Self, rhs: u32) -> Ipv4Addr1 claim

impl ipnet::IpBitOr for …

fn bitor2 implementations2 claims

impl ipnet::IpBitOr<u128> for core::net::ip_addr::Ipv6Addr

pub fn bitor(self: Self, rhs: u128) -> Ipv6Addr1 claim

impl ipnet::IpBitOr<u32> for core::net::ip_addr::Ipv4Addr

pub fn bitor(self: Self, rhs: u32) -> Ipv4Addr1 claim

impl ipnet::IpSub for …

fn saturating_sub2 implementations2 claims

impl ipnet::IpSub<u128> for core::net::ip_addr::Ipv6Addr

pub fn saturating_sub(self: Self, rhs: u128) -> Ipv6Addr1 claim

impl ipnet::IpSub<u32> for core::net::ip_addr::Ipv4Addr

pub fn saturating_sub(self: Self, rhs: u32) -> Ipv4Addr1 claim

Blanket implementations

impl alloc::borrow::ToOwned for …

fn clone_into11 implementations—
fn to_owned11 implementations—

impl alloc::string::ToString for …

fn to_string5 implementations—

impl core::any::Any for …

fn type_id11 implementations—

impl core::borrow::Borrow<T> for …

fn borrow11 implementations—

impl core::borrow::BorrowMut<T> for …

fn borrow_mut11 implementations—

impl core::clone::CloneToUninit for …

unsafe fn clone_to_uninit11 implementations—

impl core::convert::From<T> for …

fn from11 implementations—

impl core::convert::Into<U> for …

fn into11 implementations—

impl core::convert::TryFrom<U> for …

fn try_from11 implementations—

impl core::convert::TryInto<U> for …

fn try_into11 implementations—

impl core::iter::traits::collect::IntoIterator for …

fn into_iter6 implementations—