Skip to main content

mlb_api/requests/meta/
wind_direction.rs

1use serde::Deserialize;
2
3id!(#[doc = "A [`String`] representing a direction the wind is going"] WindDirectionId { code: String });
4
5/// A detailed `struct` representing the direction wind is going.
6///
7/// Note these are not cardinal directions, you'd have to find out the venue's coordinates to calculate from these, but it's likely easier to use another weather API for wind.
8///
9/// ## Examples
10/// ```
11/// WindDirection {
12///     id: "Out to CF".into(),
13///     description: /* same as id */
14/// }
15/// ```
16#[derive(Debug, Deserialize, Clone)]
17pub struct WindDirection {
18	pub description: String,
19	#[serde(flatten)]
20	pub id: WindDirectionId,
21}
22
23id_only_eq_impl!(WindDirection, id);
24meta_kind_impl!("windDirection" => WindDirection);
25tiered_request_entry_cache_impl!(WindDirection.id: WindDirectionId);
26test_impl!(WindDirection);