This directory contains example code that makes use of async-std, each of which can be run from the command line.
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.tomlLists 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 loggingPrints a file given as an argument to stdout.
cargo run --example print-file ./Cargo.tomlPrints response of GET request made to TCP server with 5 second socket timeout
cargo run --example socket-timeoutsEchoes lines read on stdin to stdout.
cargo run --example stdin-echoReads a line from stdin, or exits with an error if nothing is read in 5 seconds.
cargo run --example stdin-timeoutSends an HTTP request to the Rust website.
cargo run --example surf-webCreates a task-local value.
cargo run --example task-localSpawns a named task that prints its name.
cargo run --example task-nameConnects to Localhost over TCP.
First, start the echo server:
cargo run --example tcp-echoThen run the client:
cargo run --example tcp-clientTCP echo server.
Start the echo server:
cargo run --example tcp-echoMake requests by running the client example:
cargo run --example tcp-clientConnects to Localhost over UDP.
First, start the echo server:
cargo run --example udp-echoThen run the client:
cargo run --example udp-clientUDP echo server.
Start the echo server:
cargo run --example udp-echoMake requests by running the client example:
cargo run --example udp-client