pub trait Address: Sized + Clone {
// Required methods
fn same_host(&self, other: &Self) -> bool;
fn same(&self, other: &Self) -> bool;
fn is_broadcast(&self) -> bool;
}
Expand description
An address type, for use with the Socket
trait.
Required Methods§
Sourcefn same_host(&self, other: &Self) -> bool
fn same_host(&self, other: &Self) -> bool
Are the two addresses the same host?
For IP based addresses, this checks if the IP of two addresses are the same.
Sourcefn same(&self, other: &Self) -> bool
fn same(&self, other: &Self) -> bool
Are the two addresses exactly the same?
For IP based addresses, this checks if the IP and port of two addresses are the same.
Sourcefn is_broadcast(&self) -> bool
fn is_broadcast(&self) -> bool
Is this a broadcast address?
For IP based addresses, checks if this is the IPv4 broadcast address.
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.