|
|
@ -75,19 +75,21 @@ syntax.
|
|
|
|
## Examples
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
|
|
|
|
```rust
|
|
|
|
```rust
|
|
|
|
use async_std::task;
|
|
|
|
async fn say_hello() {
|
|
|
|
|
|
|
|
println!("Hello, world!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
#[async_std::main]
|
|
|
|
task::block_on(async {
|
|
|
|
async fn main() {
|
|
|
|
println!("Hello, world!");
|
|
|
|
say_hello().await;
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
More examples, including networking and file access, can be found in our
|
|
|
|
More examples, including networking and file access, can be found in our
|
|
|
|
[`examples`] directory.
|
|
|
|
[`examples`] directory and in our [documentation].
|
|
|
|
|
|
|
|
|
|
|
|
[`examples`]: https://github.com/async-rs/async-std/tree/master/examples
|
|
|
|
[`examples`]: https://github.com/async-rs/async-std/tree/master/examples
|
|
|
|
|
|
|
|
[documentation]: https://docs.rs/async-std#examples
|
|
|
|
|
|
|
|
|
|
|
|
## Philosophy
|
|
|
|
## Philosophy
|
|
|
|
|
|
|
|
|
|
|
|