pub trait InetPair:
Copy
+ Debug
+ Eq
+ Hash
+ PrivInetPair {
type Address: Address<InetPair = Self>;
// Required methods
fn new(
first: <Self::Address as Address>::Inet,
second: <Self::Address as Address>::Inet,
) -> Result<Self, InetTupleError>;
fn new_from_addresses(
first: Self::Address,
second: Self::Address,
len: u8,
) -> Result<Self, InetTupleError>;
fn first(&self) -> <Self::Address as Address>::Inet;
fn second(&self) -> <Self::Address as Address>::Inet;
fn network(&self) -> <Self::Address as Address>::Cidr;
fn network_length(&self) -> u8;
fn family(&self) -> Family;
fn iter(self) -> InetIterator<Self::Address> ⓘ;
}
Expand description
Pair of two addresses in the same network
Required Associated Types§
Required Methods§
Sourcefn new(
first: <Self::Address as Address>::Inet,
second: <Self::Address as Address>::Inet,
) -> Result<Self, InetTupleError>
fn new( first: <Self::Address as Address>::Inet, second: <Self::Address as Address>::Inet, ) -> Result<Self, InetTupleError>
Create new pair from two addresses in the same network
Fails if the addresses are not in the same network.
Sourcefn new_from_addresses(
first: Self::Address,
second: Self::Address,
len: u8,
) -> Result<Self, InetTupleError>
fn new_from_addresses( first: Self::Address, second: Self::Address, len: u8, ) -> Result<Self, InetTupleError>
Create new pair from two addresses and a common length
Fails if the network length is invalid for the addresses or the addresses are not in the same network.
Sourcefn network(&self) -> <Self::Address as Address>::Cidr
fn network(&self) -> <Self::Address as Address>::Cidr
network (i.e. drops the host information)
Sourcefn network_length(&self) -> u8
fn network_length(&self) -> u8
length in bits of the shared prefix of the contained addresses
Sourcefn iter(self) -> InetIterator<Self::Address> ⓘ
fn iter(self) -> InetIterator<Self::Address> ⓘ
Iterate over first..=second
(inclusive)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.