#api-client #client #api #moe #endpoint

bangumi

A bangumi.moe API client written in Rust

1 unstable release

0.1.0 Apr 22, 2023

#56 in #endpoint

MIT license

20KB
549 lines

Bangumi

This is a Rust library for the Bangumi.moe API based on rustified.

Usage

# #[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(()) }

With builder

# #[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.

Dependencies

~8–23MB
~352K SLoC