]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #73761 - rijenkii:master, r=KodrAus
authorbors <bors@rust-lang.org>
Fri, 11 Sep 2020 21:54:31 +0000 (21:54 +0000)
committerbors <bors@rust-lang.org>
Fri, 11 Sep 2020 21:54:31 +0000 (21:54 +0000)
Add `peek` and `peek_from` to `UnixStream` and `UnixDatagram`

This is my first PR, so I'm sure I've done some things wrong.

This PR:
  * adds `peek` function to `UnixStream`;
  * adds `peek` and `peek_from` to `UnixDatagram`;
  * moves `UnixDatagram::recv_from` implementation to a private function `recv_from_flags`, as `peek_from` uses the same code, just with different flags.

I've taken the documentation from `TcpStream` and `UdpStream`, so it may or may not make sense (I'm bad with english words).
Also, I'm not sure what I should write in the `unstable` attribute, so I've made up the name and set the issue to "none".

Closes #68565.


Trivial merge