Trait iprange::IpNet [−][src]
pub trait IpNet: ToNetwork<Self> + Debug + Ord + Copy where
Self: Sized, { type S: TraverseState<Net = Self>; type I: Iterator<Item = bool>; fn prefix_bits(&self) -> Self::I; fn prefix_len(&self) -> u8; fn with_new_prefix(&self, len: u8) -> Self; }
Expand description
An abstraction for IP networks.
Associated Types
type S: TraverseState<Net = Self>
[src]
Expand description
Used for internal traversing.
type I: Iterator<Item = bool>
[src]
Expand description
I
is an iterator to the prefix bits of the network.
Required methods
fn prefix_bits(&self) -> Self::I
[src]
Expand description
Returns the iterator to the prefix bits of the network.
fn prefix_len(&self) -> u8
[src]
Expand description
Returns the prefix length.
fn with_new_prefix(&self, len: u8) -> Self
[src]
Expand description
Returns a copy of the network with the address truncated to the given length.
Implementations on Foreign Types
impl IpNet for Ipv4Net
[src]
impl IpNet for Ipv4Net
[src]type S = Ipv4TraverseState
type I = Ipv4PrefixBitIterator
fn prefix_bits(&self) -> Self::I
[src]
fn prefix_len(&self) -> u8
[src]
fn with_new_prefix(&self, len: u8) -> Self
[src]
impl IpNet for Ipv6Net
[src]
impl IpNet for Ipv6Net
[src]