Skip to main content

mlb_api/requests/meta/
sky.rs

1use serde::Deserialize;
2
3id!(#[doc = "A [`String`] describing the conditions of the sky"] SkyDescriptionId { code: String });
4
5/// A detailed `struct` representing the sky conditions
6///
7/// ## Examples
8/// ```no_run
9/// SkyDescription {
10///     description: "Clear".into(),
11///     id: "Clear".into(),
12/// }
13/// ```
14#[derive(Debug, Deserialize, Clone)]
15pub struct SkyDescription {
16	pub description: String,
17	#[serde(flatten)]
18	pub id: SkyDescriptionId,
19}
20
21id_only_eq_impl!(SkyDescription, id);
22meta_kind_impl!("sky" => SkyDescription);
23tiered_request_entry_cache_impl!(SkyDescription.id: SkyDescriptionId);
24test_impl!(SkyDescription);
25
26/// Whether the sky shows daytime or nighttime
27#[derive(Debug, Deserialize, PartialEq, Eq, Copy, Clone)]
28pub enum DayNight {
29	/// Day Game.
30	#[serde(rename = "day")]
31	Day,
32
33	/// Night Game.
34	#[serde(rename = "night")]
35	Night,
36}