pub trait AddressInfoView {
// Required methods
fn address(&self) -> SocketAddress;
fn socket_type(&self) -> SocketType;
fn protocol(&self) -> Option<SocketProtocol>;
// Provided method
fn to_address_info(&self) -> AddressInfo { ... }
}Expand description
Portable accessors for a resolved IP endpoint and its socket creation parameters. A view may borrow a native resolver entry; accessing one field need not copy or normalize the others.
Required Methods§
Sourcefn address(&self) -> SocketAddress
fn address(&self) -> SocketAddress
Decode the IP endpoint on demand, preserving IPv6 flow information and scope identifiers.
Sourcefn socket_type(&self) -> SocketType
fn socket_type(&self) -> SocketType
The socket type for creating a socket to this endpoint.
Sourcefn protocol(&self) -> Option<SocketProtocol>
fn protocol(&self) -> Option<SocketProtocol>
None represents the resolver’s zero/default protocol.
Provided Methods§
Sourcefn to_address_info(&self) -> AddressInfo
fn to_address_info(&self) -> AddressInfo
Explicitly materialize a small, owned portable record. This conversion requires no heap allocation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".