async-std/examples
2019-09-25 20:21:59 -04:00
..
a-chat Fix compilation errors on latest nightly 2019-09-11 17:17:20 +02:00
hello-world.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
line-count.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
list-dir.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
logging.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
print-file.rs More robust file implementation 2019-09-07 23:17:20 +02:00
README.md add logging and print file examples 2019-09-25 20:21:59 -04:00
socket-timeouts.rs Fix compilation errors on latest nightly 2019-09-11 17:17:20 +02:00
stdin-echo.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
stdin-timeout.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
surf-web.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
task-local.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
task-name.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
tcp-client.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
tcp-echo.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
udp-client.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00
udp-echo.rs remove async_await feature gate 2019-08-21 00:29:35 -07:00

async-std Examples

This directory contains example code that makes use of async-std, each of which can be run from the command line.

Examples

Spawns a task that says hello.

cargo run --example hello-world

Counts the number of lines in a file given as an argument.

cargo run --example line-count -- ./Cargo.toml

Lists files in a directory given as an argument.

cargo run --example list-dir -- .

Prints the runtime's execution log on the standard output.

cargo run --example logging

Prints a file given as an argument to stdout.

cargo run --example print-file ./Cargo.toml