Skip to main content

team_hydrations

Macro team_hydrations 

Source
macro_rules! team_hydrations {
    (@ inline_structs [previous_schedule: { $($inline_tt:tt)* } $(, $($tt:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
    (@ inline_structs [next_schedule: { $($inline_tt:tt)* } $(, $($tt:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
    (@ inline_structs [venue: { $($inline_tt:tt)* } $(, $($tt:tt)*)?] $vis:vis struct $name:ident { $($field_tt:tt)* }) => { ... };
    (@ inline_structs [spring_venue: { $($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 [standings: { $($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)* }) => { ... };
    (@ sport) => { ... };
    (@ sport $hydrations:ty) => { ... };
    (@ venue) => { ... };
    (@ venue $hydrations:ty) => { ... };
    (@ unknown_venue) => { ... };
    (@ unknown_venue $hydrations:ty) => { ... };
    (@ spring_venue) => { ... };
    (@ spring_venue $hydrations:ty) => { ... };
    (@ league) => { ... };
    (@ league ,) => { ... };
    (@ unknown_league) => { ... };
    (@ unknown_league ,) => { ... };
    (@ division) => { ... };
    (@ division ,) => { ... };
    (@ actual $vis:vis struct $name:ident {
		$(previous_schedule: $previous_schedule:ty ,)?
		$(next_schedule: $next_schedule:ty ,)?
		$(venue: $venue:ty ,)?
		$(spring_venue: $spring_venue:ty ,)?
		$(social $social_comma:tt)?
		$(league $league_comma:tt)?
		$(sport: $sport:ty ,)?
		$(standings: $standings:ty ,)?
		$(division $division_comma:tt)?
		$(external_references $external_references_comma:tt)?
	}) => { ... };
    ($vis:vis struct $name:ident {
		$($tt:tt)*
	}) => { ... };
}
Expand description

Creates hydrations for a team

§Examples

use mlb_api::team::{Team, TeamsRequest};
use mlb_api::team_hydrations;

team_hydrations! {
    pub struct ExampleHydrations {
         venue: { field_info },
         social,
         sport: (),
         standings: (),
         external_references
    }
}

let [team]: [Team<ExampleHydrations>; 1] = TeamsRequest::<ExampleHydrations>::builder().team_id(141).build_and_get().await.unwrap().teams.try_into().unwrap();

§Team Hydrations

Note: Fields must appear in exactly this order (or be omitted)

NameType
previous_scheduleschedule_hydrations!
next_scheduleschedule_hydrations!
venuevenue_hydrations!
spring_venuevenue_hydrations!
socialHashMap<String, Vec<String>>
leagueLeague
sportsports_hydrations!
standingsstandings_hydrations!
divisionDivision
external_referencesExternalReference