pub trait IpNet: ToNetwork<Self> + Debug + Ord + Copywhere
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.
Required Associated Types§
sourcetype S: TraverseState<Net = Self>
type S: TraverseState<Net = Self>
Used for internal traversing.
Required Methods§
sourcefn prefix_bits(&self) -> Self::I
fn prefix_bits(&self) -> Self::I
Returns the iterator to the prefix bits of the network.
sourcefn prefix_len(&self) -> u8
fn prefix_len(&self) -> u8
Returns the prefix length.
sourcefn with_new_prefix(&self, len: u8) -> Self
fn with_new_prefix(&self, len: u8) -> Self
Returns a copy of the network with the address truncated to the given length.