This is the Pokémon TCG SDK Rust implementation. It is a wrapper around the Pokémon TCG API of pokemontcg.io.
toml
[dependencies]
pokemon-tcg-sdk = "0.1.1"
rust
// This method fails if a TLS backend cannot be initialized, or the resolver cannot load the system configuration.
let client = Client::new(Some("YOUR_API_KEY"))?;
```rust let client = Client::default(); let card = client.get_card(GetCardRequest::new("base1-1")).await;
match card { // Card Ok(c) => println!("{:?}", c), // Will be a 'ClientError' enum Err(e) => println!("{:?}", e), } ```
```rust let client = Client::default(); let cards = client.search_cards(SearchCardsRequest::new("name:celebi")).await;
match cards {
// Vec
// You can also construct a SearchCardsRequest with more parameters let searchrequest = SearchCardsRequest { query: Some(String::fromstr("name:celebi")), page: Some(10), pagesize: None, orderby: None, } ```
```rust let client = Client::default(); let cards = client.getallcards().await;
match cards {
// Vec
```rust let client = Client::default(); let set = client.get_set(GetSetRequest::new("base1")).await;
match set { // Set Ok(s) => println!("{:?}", s), // Will be a 'ClientError' enum Err(e) => println!("{:?}", e), } ```
```rust let client = Client::default(); let sets = client.search_sets(SearchSetsRequest::new("series:base")).await;
match sets {
// Vec
// You can also construct a SearchSetsRequest with more parameters let searchrequest = SearchSetsRequest { query: Some(String::fromstr("series:base")), page: Some(2), pagesize: None, orderby: None, } ```
```rust let client = Client::default(); let sets = client.getallsets().await;
match sets {
// Vec
```rust let client = Client::default(); let types = client.get_supertypes().await;
match types {
// Vec
```rust let client = Client::default(); let types = client.get_subtypes().await;
match types {
// Vec
```rust let client = Client::default(); let types = client.get_types().await;
match types {
// Vec
```rust let client = Client::default(); let types = client.get_rarities().await;
match types {
// Vec