Skip to main content

person_hydrations

Macro person_hydrations 

Source
macro_rules! person_hydrations {
    (
		$vis:vis struct $name:ident {
			$(awards $awards_comma:tt)?
			$(current_team $current_team_comma:tt)?
			$(depth_charts $depth_charts_comma:tt)?
			$(draft $draft_comma:tt)?
			$(education $education_comma:tt)?
			$(jobs $jobs_comma:tt)?
			$(nicknames $nicknames_comma:tt)?
			$(preferred_team $preferred_team_comma:tt)?
			$(relatives $relatives_comma:tt)?
			$(roster_entries $roster_entries_comma:tt)?
			$(transactions $transactions_comma:tt)?
			$(social $social_comma:tt)?
			$(stats: $stats:path ,)?
			$(xref_id $xref_id_comma:tt)?
		}
    ) => { ... };
}
Expand description

Creates hydrations for a person, ex:

person_hydrations! {
    pub struct ExampleHydrations {  ->  pub struct ExampleHydrations {
        awards,                     ->      awards: Vec<Award>,
        social,                     ->      social: HashMap<String, Vec<String>>,
        stats: MyStats,             ->      stats: MyStats,
    }                               ->  }
}

The list of valid hydrations are:

  • awards
  • current_team
  • depth_charts
  • draft
  • education
  • jobs
  • nicknames
  • preferred_team
  • relatives
  • roster_entries
  • transactions
  • social
  • stats
  • xref_id

Note: these must appear in exactly this order