FP Complete

Owned Values and Futures in Rust Programming

Let’s write a simple tokio-powered program that will download the contents of an HTTP response body using reqwest and print it to stdout. We’ll take the URL to download on the command line using clap. This might look something like the following: use anyhow::Result; use clap::Parser; #[derive(Parser)] struct Opt { url: String, } #[tokio::main] async fn main() -> Result<()> […]