Crate shuller

Crate shuller 

Source
Expand description

§Shuller

Crate for making links by something structures and Getting some data from links

§Example

use shuller::prelude::*;

async fn example() {
    let instance: Posts = R34Params::init()
        .positive_tags(vec!["dark", "fish"])
        .negative_tags(vec!["ai_generated"])
        .limit(3)
        .download()
        .await
        .unwrap();
        println!("{:#?}", instance.get_urls_ext())
}

§Example via macro

use shuller::prelude::*;

async fn macro_normal() {
    let instance = R34!(
        p = vec!["dark", "fish"],
        n = vec!["ai_generated"],
        limit = 2,
        page = 2
    )
    .download()
    .await
    .unwrap();
    assert!(instance.get_f_urls().len() == 2)
}
async fn macro_download() {
    let instance = R34!(D;
        p = vec!["dark", "fish"],
        n = vec!["ai_generated"],
        limit = 2,
        page = 2
    )
    .unwrap();
    assert!(instance.get_f_urls().len() == 2)
}
async fn macro_url() {
    let instance = R34!(U;
        p = vec!["dark", "fish"],
        n = vec!["ai_generated"],
        limit = 2,
        page = 2
    );
    assert!(instance.is_special())
}

async fn random() {
    let params = R34!(R;);
    let url = R34!(R; D).unwrap();
    let posts = R34!(R; U);
}

Modules§

prelude
Just all that you need
rules
Rules for making links

Macros§

R34
Macros for fast creating rule34 params by using specific pattern
random_usize
Generate random usize number in customizable max range
random_usize_vec
Generates a vector of random unique elements from a given vector.
random_usize_vec_cloned
Same random_usize_vec with clone
tag_suppress
Concat 2 arraes into 1 String with adding “-” for itch item in second array
toggler
Bool converter to str