romio 0.3.0-alpha.10

Event loop and I/O resources for asynchronous network services using futures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::io;

use futures::executor;
use futures::io::{AllowStdIo, AsyncReadExt};

use romio::TcpStream;

fn main() -> io::Result<()> {
    executor::block_on(async {
        let stream = TcpStream::connect(&"127.0.0.1:7878".parse().unwrap()).await?;
        let mut stdout = AllowStdIo::new(io::stdout());
        stream.copy_into(&mut stdout).await?;
        Ok(())
    })
}