Testing adapted from this tutorial.
Required parameters:
-t
or--tickers
: An array of space separated, quote-wrapped tickers
cargo install cargo-edit
cargo add {CRATE}
use std::env;
use dotenv::dotenv;
use finnhub_rs::client::Client;
const FINNHUB_KEY: &str = "FINNHUB_TOKEN";
#[tokio::main]
async fn main() {
dotenv().ok();
let token = env::var(FINNHUB_KEY).expect("Key not present in .env file");
let client = Client::new(token);
let res = client.stock_symbol("US".to_string()).await.expect("Invalid response");
println!("{:#?}", res);
}