Crates.io | bangumi |
lib.rs | bangumi |
version | 0.1.0 |
source | src |
created_at | 2023-04-22 05:14:07.965257 |
updated_at | 2023-04-22 05:14:07.965257 |
description | A bangumi.moe API client written in Rust |
homepage | |
repository | https://github.com/George-Miao/bangumi |
max_upload_size | |
id | 845823 |
size | 19,519 |
This is a Rust library for the Bangumi.moe API based on rustified.
# #[tokio::test] async fn doc_test_1() -> Result<(), Box<dyn std::error::Error>>{ use bangumi::*;
use bangumi::{endpoints::GetCurrent, Endpoint};
let client = bangumi::client();
let result: Vec<WithId<Bangumi>> = GetCurrent.exec(&client).await?.parse()?;
# Ok(()) }
# #[tokio::test] async fn doc_test_2() -> Result<(), Box<dyn std::error::Error>>{ use bangumi::*;
use bangumi::{endpoints::SearchTags, Endpoint};
let client = bangumi::client();
let result: SearchResult<Vec<WithId<Tag>>> =
SearchTags::builder()
.name("魔法少女")
.keywords(false)
.tag_type(TagType::Bangumi)
.build()
.exec(&client)
.await?
.parse()?;
# Ok(()) }
For all endpoints, see endpoints.