pokeapi-macro 1.1.1

Attribute macro for `pokeapi-model` structs.
Documentation

Usage

Consider the following example:

use pokeapi_macro::pokeapi_struct;
use std::marker::PhantomData;

#[pokeapi_struct]
struct NamedAPIResource<T> {
    description: String,
    url: String,
    #[serde(skip)]
    _resource_type: PhantomData<*const T>,
}

This attribute will output the struct with required derived traits and visibility:

#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct NamedAPIResource<T> {
    pub description: String,
    pub url: String,
    #[serde(skip)]
    _resource_type: PhantomData<*const T>
}