Skip to main content

Net

Trait Net 

Source
trait Net: IpNet {
    const ADDR_BITS: u8;

    // Required method
    fn all() -> Self;

    // Provided method
    fn host_count_saturating(&self) -> u128 { ... }
}
Expand description

Ipv4Net or Ipv6Net - IP-version specific handling

Required Associated Constants§

Source

const ADDR_BITS: u8

How many bits?

Required Methods§

Source

fn all() -> Self

Return a /0 netblock.

Provided Methods§

Source

fn host_count_saturating(&self) -> u128

How many hosts in this netblock?

If the answer is 2^128, gives 2^128-1 instead.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Net for Ipv4Net

Source§

const ADDR_BITS: u8 = 32

Source§

fn all() -> Self

Source§

impl Net for Ipv6Net

Source§

const ADDR_BITS: u8 = 128

Source§

fn all() -> Self

Implementors§