#e621 #api #client #requests #toml #e621-e926

yanked e621-rs

A library which can be used to access the e621/e926 API

4 releases

0.1.3 May 22, 2021
0.1.2 May 22, 2021
0.1.1 May 21, 2021
0.1.0 Jul 26, 2020

#8 in #e621

MIT license

8KB
172 lines

e621-rs

Install

Add latest the library to your Cargo.tml

Cargo Gitea

Example

Cargo.toml:

...
[dependencies]
e621-rs = "0.1.2"
tokio = { version = "1.0", features = ["full"] }

main.rs

use e621_rs::e621_client::Client;
use e621_rs::requests::PostsListOptions;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new(
        String::from("https://e621.net"),
        String::from("MyProject/1.0 (by username on e621)"),
        String::from("username"),
        String::from("apikey")
    ).unwrap();

    let res = client.post_list(
        PostsListOptions {
            limit: Some(32),
            tags: Some(String::from("lucario")),
            page: None
        }
    ).await;

    println!("{:?}", res);
    Ok(())
}

Dependencies

~6–20MB
~294K SLoC