Function bevy::tasks::futures_lite::io::split

pub fn split<T>(stream: T) -> (ReadHalf<T>, WriteHalf<T>)
where T: AsyncRead + AsyncWrite + Unpin,
Available on crate feature std only.
Expand description

Splits a stream into AsyncRead and AsyncWrite halves.

ยงExamples

use futures_lite::io::{self, Cursor};

let stream = Cursor::new(vec![]);
let (mut reader, mut writer) = io::split(stream);