Add Read::initializer
.
This is an API that allows types to indicate that they can be passed buffers of uninitialized memory which can improve performance.
This commit is contained in:
parent
445077963c
commit
ecbb896b9e
28 changed files with 222 additions and 269 deletions
|
@ -198,10 +198,6 @@ impl Socket {
|
|||
self.recv_from_with_flags(buf, MSG_PEEK)
|
||||
}
|
||||
|
||||
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
|
||||
self.0.read_to_end(buf)
|
||||
}
|
||||
|
||||
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
|
||||
self.0.write(buf)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue