Skip to content

Commit a0a18d3

Browse files
committed
Include examples for textual representation of SocketAddrV6
(Examples are from the IPv6 address range reserved for documentation in IETF RFC 3849.)
1 parent 6391d42 commit a0a18d3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/core/src/net/socket_addr.rs

+5
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ pub struct SocketAddrV4 {
106106
/// - A colon (`:`)
107107
/// - The port, encoded as a decimal integer.
108108
///
109+
/// For example, the string `[2001:db8::413]:443` represents a `SocketAddrV6`
110+
/// with the address `2001:db8::413` and port `443`. The string
111+
/// `[2001:db8::413%612]:443` represents the same address and port, with a
112+
/// scope identifier of `612`.
113+
///
109114
/// Other formats are not accepted.
110115
///
111116
/// [IETF RFC 5952]: https://tools.ietf.org/html/rfc5952#section-6

0 commit comments

Comments
 (0)