macro_rules! standings_hydrations {
(@ inline_structs [team: { $($inline_tt:tt)* } $(, $($tt:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ inline_structs [sport: { $($inline_tt:tt)* } $(, $($tt:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ inline_structs [$_01:ident : { $($_02:tt)* $(, $($tt:tt)*)?}] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ inline_structs [$field:ident $(: $value:ty)? $(, $($tt:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ inline_structs [] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
(@ team) => { ... };
(@ team $team:ty) => { ... };
(@ league) => { ... };
(@ league ,) => { ... };
(@ unknown_league) => { ... };
(@ unknown_league ,) => { ... };
(@ division) => { ... };
(@ division ,) => { ... };
(@ sport) => { ... };
(@ sport $hydrations:ty) => { ... };
(@ actual $vis:vis struct $name:ident {
$(team: $team:ty ,)?
$(league $league_comma:tt)?
$(division $division_comma:tt)?
$(sport: $sport:ty ,)?
}) => { ... };
($vis:vis struct $name:ident {
$($field_tt:tt)*
}) => { ... };
}Expand description
Creates hydrations for a standings request
§Examples
use mlb_api::standings::{StandingsRequest, StandingsResponse};
use mlb_api::standings_hydrations;
standings_hydrations! {
pub struct ExampleHydrations {
team: (),
league,
sport: { season }
}
}
let response: StandingsResponse<ExampleHydrations> = StandingsRequest::<ExampleHydrations>::builder().build_and_get().await.unwrap();§Standings Hydrations
Note: Fields must appear in exactly this order (or be omitted)
| Name | Type |
|---|---|
team | team_hydrations! |
league | League |
division | Division |
sport | sports_hydrations! |