#[non_exhaustive]pub enum Frequency {
Daily,
Weekly,
Biweekly,
Monthly,
Quarterly,
Semiannual,
Annual,
Other(String),
}Expand description
The native reporting frequency of a FRED series.
Deserialized from FRED’s long-form frequency label (e.g. "Monthly").
Labels this version does not model — for instance the week-ending variants
like "Weekly, Ending Friday" — are preserved verbatim in
Frequency::Other rather than failing to deserialize (ADR-0005:
forward-compatibility over strictness). The enum is also #[non_exhaustive]
so new named variants can be promoted out of Other later without breaking
callers’ match arms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Daily
Daily.
Weekly
Weekly.
Biweekly
Biweekly.
Monthly
Monthly.
Quarterly
Quarterly.
Semiannual
Semiannual.
Annual
Annual.
Other(String)
A frequency FRED reported that this version does not model; holds the raw label verbatim.
Implementations§
Source§impl Frequency
impl Frequency
Sourcepub fn query_code(&self) -> &str
pub fn query_code(&self) -> &str
The FRED query code for requesting aggregation to this frequency (the
observations frequency parameter): d, w, bw, m, q, sa,
a. For Frequency::Other this returns the raw label, which may not
be a valid FRED code.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Frequency
impl<'de> Deserialize<'de> for Frequency
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for Frequency
Source§impl Serialize for Frequency
impl Serialize for Frequency
Source§fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
Serializes as FRED’s long-form label — symmetric with Deserialize, so
the value round-trips.