@@ -41,7 +41,7 @@ pub enum SocketAddr {
41
41
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
42
42
pub struct SocketAddrV4 { inner : libc:: sockaddr_in }
43
43
44
- /// An IPv6 socket address
44
+ /// An IPv6 socket address.
45
45
#[ derive( Copy ) ]
46
46
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
47
47
pub struct SocketAddrV6 { inner : libc:: sockaddr_in6 }
@@ -56,7 +56,7 @@ impl SocketAddr {
56
56
}
57
57
}
58
58
59
- /// Gets the IP address associated with this socket address.
59
+ /// Returns the IP address associated with this socket address.
60
60
#[ unstable( feature = "ip_addr" , reason = "recent addition" ) ]
61
61
pub fn ip ( & self ) -> IpAddr {
62
62
match * self {
@@ -65,7 +65,7 @@ impl SocketAddr {
65
65
}
66
66
}
67
67
68
- /// Gets the port number associated with this socket address
68
+ /// Returns the port number associated with this socket address.
69
69
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
70
70
pub fn port ( & self ) -> u16 {
71
71
match * self {
@@ -89,15 +89,15 @@ impl SocketAddrV4 {
89
89
}
90
90
}
91
91
92
- /// Gets the IP address associated with this socket address.
92
+ /// Returns the IP address associated with this socket address.
93
93
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
94
94
pub fn ip ( & self ) -> & Ipv4Addr {
95
95
unsafe {
96
96
& * ( & self . inner . sin_addr as * const libc:: in_addr as * const Ipv4Addr )
97
97
}
98
98
}
99
99
100
- /// Gets the port number associated with this socket address
100
+ /// Returns the port number associated with this socket address.
101
101
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
102
102
pub fn port ( & self ) -> u16 { ntoh ( self . inner . sin_port ) }
103
103
}
@@ -120,24 +120,24 @@ impl SocketAddrV6 {
120
120
}
121
121
}
122
122
123
- /// Gets the IP address associated with this socket address.
123
+ /// Returns the IP address associated with this socket address.
124
124
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
125
125
pub fn ip ( & self ) -> & Ipv6Addr {
126
126
unsafe {
127
127
& * ( & self . inner . sin6_addr as * const libc:: in6_addr as * const Ipv6Addr )
128
128
}
129
129
}
130
130
131
- /// Gets the port number associated with this socket address
131
+ /// Returns the port number associated with this socket address.
132
132
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
133
133
pub fn port ( & self ) -> u16 { ntoh ( self . inner . sin6_port ) }
134
134
135
- /// Gets scope ID associated with this address, corresponding to the
135
+ /// Returns scope ID associated with this address, corresponding to the
136
136
/// `sin6_flowinfo` field in C.
137
137
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
138
138
pub fn flowinfo ( & self ) -> u32 { ntoh ( self . inner . sin6_flowinfo ) }
139
139
140
- /// Gets scope ID associated with this address, corresponding to the
140
+ /// Returns scope ID associated with this address, corresponding to the
141
141
/// `sin6_scope_id` field in C.
142
142
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
143
143
pub fn scope_id ( & self ) -> u32 { ntoh ( self . inner . sin6_scope_id ) }
0 commit comments