fn split(self) -> (ReadHalf<Self>, WriteHalf<Self>)
    where
        Self: AsyncWrite + Sized,
    {
        let (r, w) = split::split(self);
        (assert_read(r), assert_write(w))
    }
/// Helper method for splitting this read/write object into two halves.
///
/// The two halves returned implement the `AsyncRead` and `AsyncWrite`
/// traits, respectively.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::io::{self, AsyncReadExt, Cursor};
///
/// // Note that for `Cursor` the read and write halves share a single
/// // seek position. This may or may not be true for other types that
/// // implement both `AsyncRead` and `AsyncWrite`.
///
/// let reader = Cursor::new([1, 2, 3, 4]);
/// let mut buffer = Cursor::new(vec![0, 0, 0, 0, 5, 6, 7, 8]);
/// let mut writer = Cursor::new(vec![0u8; 5]);
///
/// {
///     let (buffer_reader, mut buffer_writer) = (&mut buffer).split();
///     io::copy(reader, &mut buffer_writer).await?;
///     io::copy(buffer_reader, &mut writer).await?;
/// }
///
/// assert_eq!(buffer.into_inner(), [1, 2, 3, 4, 5, 6, 7, 8]);
/// assert_eq!(writer.into_inner(), [5, 6, 7, 8, 0]);
/// # Ok::<(), Box<dyn std::error::Error>>(()) }).unwrap();
/// ```
Helper method for splitting this read/write object into two halves.
The two halves returned implement the `AsyncRead` and `AsyncWrite`
traits, respectively.
Helper method for splitting this read / write object into two halves . The two halves returned implement the ` AsyncRead ` and ` AsyncWrite ` traits respectively .
fn split(self) -> (ReadHalf<Self>, WriteHalf<Self>)
    where
        Self: AsyncWrite + Sized,
    {
        let (r, w) = split::split(self);
        (assert_read(r), assert_write(w))
    }
fn split ( self ) -> ( ReadHalf < Self > , WriteHalf < Self > ) where Self : AsyncWrite + Sized , { let ( r , w ) = split :: split ( self ) ; ( assert_read ( r ) , assert_write ( w ) ) }
Helper method for splitting this read/write object into two halves.
Helper method for splitting this read / write object into two halves .
self
self
examples
None
futures::executor::block_on(async {
use futures::io::{self, AsyncReadExt, Cursor}.

Note that for `Cursor` the read and write halves share a single
seek position. This may or may not be true for other types that
implement both `AsyncRead` and `AsyncWrite`.



{
let (buffer_reader, mut buffer_writer) = (&mut buffer).split();
io::copy(reader, &mut buffer_writer).await?;
io::copy(buffer_reader, &mut writer).await?;
}


use futures :: io :: { self AsyncReadExt Cursor } . Note that for ` Cursor ` the read and write halves share a single seek position . This may or may not be true for other types that implement both ` AsyncRead ` and ` AsyncWrite ` . { let ( buffer_reader mut buffer_writer ) = ( &mut buffer ) . split () ; io :: copy ( reader &mut buffer_writer ) . await? ; io :: copy ( buffer_reader &mut writer ) . await? ; }
ok::<(), box<dyn std::error::error>>(()) }).unwrap();
None