[][src]Struct rick_and_morty::character::Character

pub struct Character {
    pub id: i64,
    pub name: String,
    pub status: String,
    pub species: String,
    pub character_type: String,
    pub origin: Object,
    pub location: Object,
    pub gender: String,
    pub image: String,
    pub episode: Vec<String>,
    pub url: String,
    pub created: String,
}

Character closely matches character returned from character endpoint.

Fields

id: i64

character id

name: String

character name

status: String

character status: e.g "Alive"

species: String

character species

character_type: String

character.character_type is equivalent to character.type in the json object of the api.

origin: Object

character origin has origin.name and origin.url.

location: Object

character location has location.name and location.url.

gender: String

gender

image: String

image url

episode: Vec<String>

slices of episode urls

url: String

url

created: String

created date string

Implementations

impl Character[src]

pub async fn location<'_>(&'_ self) -> Result<Option<Location>, Error>[src]

Gets the Location associated with the Character object.

pub async fn origin<'_>(&'_ self) -> Result<Option<Location>, Error>[src]

Gets the Location object for the origin of the character.

pub async fn episodes<'_>(&'_ self) -> Result<Vec<Episode>, Error>[src]

Gets the episodes the character appears in.

Trait Implementations

impl Clone for Character[src]

impl Debug for Character[src]

impl Default for Character[src]

impl<'de> Deserialize<'de> for Character[src]

impl PartialEq<Character> for Character[src]

impl Serialize for Character[src]

impl StructuralPartialEq for Character[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.