[go: up one dir, main page]

tokio 0.2.13

An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![warn(rust_2018_idioms)]
#![cfg(feature = "full")]

use tokio::fs;

#[tokio::test]
async fn copy() {
    fs::write("foo.txt", b"Hello File!").await.unwrap();
    fs::copy("foo.txt", "bar.txt").await.unwrap();

    let from = fs::read("foo.txt").await.unwrap();
    let to = fs::read("bar.txt").await.unwrap();

    assert_eq!(from, to);
}