Struct pokeapi_types::Pokemon[][src]

pub struct Pokemon {
Show 17 fields pub abilities: Vec<PokemonAbility>, pub base_experience: u32, pub forms: Vec<NamedAPIResource>, pub game_indices: Vec<VersionGameIndex>, pub height: u32, pub held_items: Vec<PokemonHeldItem>, pub id: u32, pub is_default: bool, pub location_area_encounters: String, pub moves: Vec<PokemonMove>, pub name: String, pub order: u32, pub species: NamedAPIResource, pub sprites: PokemonSprites, pub stats: Vec<PokemonStat>, pub types: Vec<PokemonType>, pub weight: u32,
}
Expand description

This is the JSON struct for the endpoint /pokemon/{id}

Examples

use pokeapi_types::Pokemon;

async fn getBulbasaur() {
    let response = reqwest::get("https://pokeapi.co/api/v2/pokemon/1/")
        .await
        .unwrap();
    let bulbasaur: Pokemon = response.json().await.unwrap();
}

Fields

abilities: Vec<PokemonAbility>base_experience: u32forms: Vec<NamedAPIResource>game_indices: Vec<VersionGameIndex>height: u32held_items: Vec<PokemonHeldItem>id: u32is_default: boollocation_area_encounters: Stringmoves: Vec<PokemonMove>name: Stringorder: u32species: NamedAPIResourcesprites: PokemonSpritesstats: Vec<PokemonStat>types: Vec<PokemonType>weight: u32

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.