| Crates.io | trent |
| lib.rs | trent |
| version | 0.1.1 |
| created_at | 2025-11-10 19:42:36.796574+00 |
| updated_at | 2025-11-28 17:59:36.820393+00 |
| description | Wrapper around the YGOPRODeck API for rust |
| homepage | |
| repository | https://github.com/shinobu-uwu/trent-rs |
| max_upload_size | |
| id | 1925998 |
| size | 82,040 |
trent is a lightweight and ergonomic Rust wrapper around the YGOPRODeck API, providing an easy way to query Yu-Gi-Oh! cards
Add this to your Cargo.toml:
[dependencies]
trent = "0.1"
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"),
}
}