macro_rules! person_hydrations {
(@ inline_structs [stats: { $($contents:tt)* } $(, $($rest:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ inline_structs [$marker:ident : { $($contents:tt)* } $(, $($rest:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ inline_structs [$marker:ident $(: $value:ty)? $(, $($rest:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ inline_structs [$(,)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ actual
$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:ty ,)?
$(external_references $external_references_comma:tt)?
}
) => { ... };
($vis:vis struct $name:ident {
$($tt:tt)*
}) => { ... };
}Expand description
Creates hydrations for a person
§Examples
person_hydrations! {
pub struct TestHydrations { -> pub struct TestHydrations {
awards, -> awards: Vec<Award>,
social, -> social: HashMap<String, Vec<String>>,
stats: MyStats, -> stats: MyStats,
} -> }
}
person_hydrations! {
pub struct TestHydrations { -> pub struct TestHydrations {
stats: { [Season] + [Hitting] }, -> stats: TestHydrationsInlineStats,
} -> }
}
let request = PersonRequest::<TestHydrations>::builder()
.id(660_271)
.hydrations(TestHydrations::builder())
.build();
let response = request.get().await.unwrap();§Person Hydrations
Note: Fields must appear in exactly this order (or be omitted)
| Name | Type |
|---|---|
awards | Vec<Award> |
current_team | Team |
depth_charts | Vec<RosterEntry> |
draft | Vec<DraftPick> |
education | Education |
jobs | Vec<EmployedPerson> |
nicknames | Vec<String> |
preferred_team | Team |
relatives | Vec<Relative> |
roster_entries | Vec<RosterEntry> |
transactions | Vec<Transaction> |
social | HashMap<String, Vec<String>> |
stats | stats_hydrations! |
external_references | Vec<ExternalReference> |