Expand description
§The Stats API
The second most likely reason you’re here.
mlb_api’s stats system designed to be simple to use.
Create a stats type, then create the hydrations which have stats in it, then request it.
Almost all the types here are for private use and occasionally might be
§Examples
See stats_hydrations! for examples on how to use the macro.
§Notes
- The stat type registry is admittedly incomplete, only some stat types are implemented (see [
stat_types]), more will come in the future. - Some stats are only implemented for specific
StatGroups, if you have a complicated request such as:
stats_hydrations! {
pub struct TechnicalStats {
[Sabermetrics, Career] + [Hitting, Pitching, Fielding, Catching]
}
}stats.sabermetrics.fielding and .catching will be of type ().
3. It is an intentional decision that SituationCodes
are not registered in an enum as if new cutting-edge situation-codes come out,
this API being outdated shouldn’t limit in that factor.
Modules§
Structs§
- Float
Counting Stat - Innings
Pitched - Percentage
Stat - Play
Stat - Plus
Stat - Three
Decimal Place Rate Stat - TwoDecimal
Place Rate Stat
Enums§
Traits§
- RawStat
- Represents the types defined in [
raw], not the wrapped final types. In the serialized format, this represents thestatfield. - Singleton
Split Stat - Represents types that are made from a single ‘split’ in the serialized format (able to be deserialized)
- Stat
Type Aliases§
- Counting
Stat - Ex: Hits
- Pitch
Stat