Types/fns concerning Internet Protocol (IP), versions 4 & 6
IpAddr
- An IP addressParseAddrErr
- Human-friendly feedback on why a parse_addr attempt failedformat_addr
- Convert a IpAddr
to a strget_addr
- Attempts name resolution on the provided node
stringget_port
- Get the associated portnet_ip::v4
net_ip::v6
IpAddr
An IP address
Ipv4(sockaddr_in)
- An IPv4 address
Ipv6(sockaddr_in6)
ParseAddrErr
pub struct ParseAddrErr {
err_msg: ~str,
}
Human-friendly feedback on why a parse_addr attempt failed
format_addr
fn format_addr(ip: &IpAddr) -> ~str
Convert a IpAddr
to a str
extra::net::ip::IpAddr
get_addr
fn get_addr(node: &str, iotask: &iotask) ->
result::Result<~[IpAddr], IpGetAddrErr>
Attempts name resolution on the provided node
string
node
- a string representing some host addressiotask
- a uv::iotask
used to interact with the underlying event loopA result<~[ip_addr], ip_get_addr_err>
instance that will contain a vector of ip_addr
results, in the case of success, or an error object in the case of failure
get_port
fn get_port(ip: &IpAddr) -> uint
Get the associated port
extra::net::ip::IpAddr