A api wrapper in Rust for trakt.tv.
Add
trakt = "0.0.2"
to your dependencies
use trakt::TraktApi;
fn main() {
let api = TraktApi::new(
"YOUR APP ID".to_owned(),
None,
);
dbg!(api.show("fairy-tail").unwrap());
}
trakt-rust also has an async implementation using futures. If you want to use it add this to your Cargo.toml
[dependencies.trakt]
version = "0.0.2"
default-features = false
features = ["async"]
use tokio::prelude::Future;
use trakt::asyn::TraktApi;
fn fetch() -> impl Future<Item = (), Error = ()> {
let api = TraktApi::new(
"CLIENT_ID".to_owned(),
None,
);
api.show("fairy-tail")
.map(|data| {
dbg!(data);
})
.map_err(|e| {
panic!(e);
})
}
fn main() {
tokio::run(fetch())
}
Powered by