#waifu #api #toml #tokio #pics

waifupics-rs

Rust wrapper for waifu.pics

2 releases

0.1.1 Jul 9, 2021
0.1.0 Jul 7, 2021

#5 in #waifu

CC0 license

14KB
177 lines

Rust wrapper for waifu.pics.

Cargo.toml

waifupics-rs = "0.1"

Example

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let img: String = waifupics_rs::get(waifupics_rs::CategorySFW::Bonk).await?;
    println!("Single image: {}", img);
    let imgs: Vec<String> = waifupics_rs::get_many(waifupics_rs::CategorySFW::Bonk).await?;
    println!("Vec of images: {:#?}", imgs);
    Ok(())
}

Dependencies

~4–18MB
~270K SLoC