trent

Crates.iotrent
lib.rstrent
version0.1.1
created_at2025-11-10 19:42:36.796574+00
updated_at2025-11-28 17:59:36.820393+00
descriptionWrapper around the YGOPRODeck API for rust
homepage
repositoryhttps://github.com/shinobu-uwu/trent-rs
max_upload_size
id1925998
size82,040
Shinobu (shinobu-uwu)

documentation

README

trent

trent is a lightweight and ergonomic Rust wrapper around the YGOPRODeck API, providing an easy way to query Yu-Gi-Oh! cards


Installation

Add this to your Cargo.toml:

[dependencies]
trent = "0.1"

Example

You can get a card by name:

let client = Client::new();
let card = client.get_by_name("Trent").await.unwrap();

match card {
    Card::Normal(m) => println!("Card name: {}", m.info.name),
    _ => panic!("Unexpected variant"),
}

Or you can also use the RequestBuilder to create a better query:

let client = Client::new();
// get all dark normal monsters with 1800 atk
let request = RequestBuilder::new()
    .with_atk(1800)
    .with_attribute(Attribute::Dark)
    .with_type(CardType::NormalMonster)
    .build();
let cards = client.get(request).await.unwrap();

for card in card {
    match card {
        Card::NormalMonster(m) => println!("{}", m.info.name),
        _ => panic!("Unexpected variant"),
    }
}
Commit count: 0

cargo fmt