Crates.io | tmdb-api |
lib.rs | tmdb-api |
version | 0.8.0 |
source | src |
created_at | 2022-10-15 10:51:25.322983 |
updated_at | 2024-03-26 12:54:27.41382 |
description | Yet another TMDB client. This one is using async methods. |
homepage | |
repository | https://github.com/jdrouet/tmdb-api |
max_upload_size | |
id | 688899 |
size | 1,469,574 |
This is yet another client for TMDB, but it supports async functions.
cargo add tmdb-api
use tmdb_api::tvshow::search::TVShowSearch;
use tmdb_api::prelude::Command;
use tmdb_api::client::Client;
use tmdb_api::client::reqwest::ReqwestExecutor;
#[tokio::main]
async fn main() {
let secret = std::env::var("TMDB_TOKEN_V3").unwrap();
let client = Client::<ReqwestExecutor>::new(secret);
let cmd = TVShowSearch::new("simpsons".into());
let result = cmd.execute(&client).await.unwrap();
let item = result.results.first().unwrap();
println!("TVShow found: {}", item.inner.name);
}
cargo test
If you want to run some integration tests, just export a TMDB_TOKEN_V3
environment variable and run
cargo test --features integration