Skip to content

Commit cb10c25

Browse files
committed
Clarify that types are Send/Sync
Also remove some `&mut self` methods as only `&self` is necessary.
1 parent 9ba9437 commit cb10c25

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

text/0517-io-os-reform.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,9 +1253,9 @@ following interface:
12531253

12541254
impl TcpStream {
12551255
fn connect<A: ToSocketAddrs>(addr: &A) -> io::Result<TcpStream>;
1256-
fn peer_addr(&mut self) -> io::Result<SocketAddr>;
1257-
fn socket_addr(&mut self) -> io::Result<SocketAddr>;
1258-
fn shutdown(&mut self, how: Shutdown) -> io::Result<()>;
1256+
fn peer_addr(&self) -> io::Result<SocketAddr>;
1257+
fn socket_addr(&self) -> io::Result<SocketAddr>;
1258+
fn shutdown(&self, how: Shutdown) -> io::Result<()>;
12591259
fn duplicate(&self) -> io::Result<TcpStream>;
12601260
}
12611261

@@ -1284,15 +1284,16 @@ impl<'a> Write for &'a TcpStream { ... }
12841284
write from a `TcpStream`
12851285

12861286
Various other options such as `nodelay` and `keepalive` will be left
1287-
`#[unstable]` for now.
1287+
`#[unstable]` for now. The `TcpStream` structure will also adhere to both `Send`
1288+
and `Sync`.
12881289

12891290
The `TcpAcceptor` struct will be removed and all functionality will be folded
12901291
into the `TcpListener` structure. Specifically, this will be the resulting API:
12911292

12921293
```rust
12931294
impl TcpListener {
12941295
fn bind<A: ToSocketAddrs>(addr: &A) -> io::Result<TcpListener>;
1295-
fn socket_addr(&mut self) -> io::Result<SocketAddr>;
1296+
fn socket_addr(&self) -> io::Result<SocketAddr>;
12961297
fn duplicate(&self) -> io::Result<TcpListener>;
12971298
fn accept(&self) -> io::Result<(TcpStream, SocketAddr)>;
12981299
fn incoming(&self) -> Incoming;
@@ -1323,11 +1324,13 @@ Some major changes from today's API include:
13231324
happen concurrently.
13241325
* For convenience the iterator does not yield the `SocketAddr` from `accept`.
13251326

1327+
The `TcpListener` type will also adhere to `Send` and `Sync`.
1328+
13261329
#### UDP
13271330
[UDP]: #udp
13281331

1329-
The UDP infrastructre will receive a similar face-lift as the TCP infrastructure
1330-
will:
1332+
The UDP infrastructure will receive a similar face-lift as the TCP
1333+
infrastructure will:
13311334

13321335
```rust
13331336
impl UdpSocket {
@@ -1352,6 +1355,8 @@ Some important points of note are:
13521355
(as with TCP streams) or with a more general implementation of `select`.
13531356
* `clone` functionality has been replaced with `duplicate`.
13541357

1358+
The `UdpSocket` type will adhere to both `Send` and `Sync`.
1359+
13551360
#### Sockets
13561361
[Sockets]: #sockets
13571362

0 commit comments

Comments
 (0)