mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
tcp: implement "split_mut" for TcpStream (#1289)
This commit is contained in:
committed by
Carl Lerche
parent
448d9d2eab
commit
0d99ddd4f4
+13
-1
@@ -1,4 +1,7 @@
|
||||
use crate::split::{split, TcpStreamReadHalf, TcpStreamWriteHalf};
|
||||
use crate::split::{
|
||||
split, split_mut, TcpStreamReadHalf, TcpStreamReadHalfMut, TcpStreamWriteHalf,
|
||||
TcpStreamWriteHalfMut,
|
||||
};
|
||||
use bytes::{Buf, BufMut};
|
||||
use futures_core::ready;
|
||||
use iovec::IoVec;
|
||||
@@ -724,6 +727,15 @@ impl TcpStream {
|
||||
split(self)
|
||||
}
|
||||
|
||||
/// Split a `TcpStream` into a read half and a write half, which can be used
|
||||
/// to read and write the stream concurrently.
|
||||
///
|
||||
/// See the module level documenation of [`split`](super::split) for more
|
||||
/// details.
|
||||
pub fn split_mut<'a>(&'a mut self) -> (TcpStreamReadHalfMut<'a>, TcpStreamWriteHalfMut<'a>) {
|
||||
split_mut(self)
|
||||
}
|
||||
|
||||
// == Poll IO functions that takes `&self` ==
|
||||
//
|
||||
// They are not public because (taken from the doc of `PollEvented`):
|
||||
|
||||
Reference in New Issue
Block a user