#[non_exhaustive]pub enum RegionType {
State,
County,
Msa,
Country,
Bea,
Other(String),
}Expand description
A geographic region granularity for a GeoFRED / Maps request (the
region_type parameter of geofred/regional/data) — the level the data is
broken down to.
Carried on the wire as a lowercase token (e.g. "state"). Tokens this
version does not name — e.g. Federal Reserve districts ("frb") or census
divisions — round-trip verbatim through RegionType::Other rather than
failing (ADR-0005: forward-compatibility over strictness), and the enum is
#[non_exhaustive] so new variants can be promoted out of Other later
without breaking callers’ match arms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
State
U.S. state.
County
U.S. county.
Msa
Metropolitan Statistical Area.
Country
Country.
Bea
Bureau of Economic Analysis region.
Other(String)
A region type FRED accepts that this version does not name; holds the raw token verbatim.
Implementations§
Source§impl RegionType
impl RegionType
Sourcepub fn query_code(&self) -> &str
pub fn query_code(&self) -> &str
The GeoFRED query token for this region type (the region_type
parameter): state, county, msa, country, bea. For
RegionType::Other this returns the raw token.
Trait Implementations§
Source§impl Clone for RegionType
impl Clone for RegionType
Source§fn clone(&self) -> RegionType
fn clone(&self) -> RegionType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RegionType
impl Debug for RegionType
Source§impl<'de> Deserialize<'de> for RegionType
impl<'de> Deserialize<'de> for RegionType
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>,
Source§impl Display for RegionType
impl Display for RegionType
impl Eq for RegionType
Source§impl PartialEq for RegionType
impl PartialEq for RegionType
Source§fn eq(&self, other: &RegionType) -> bool
fn eq(&self, other: &RegionType) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for RegionType
impl Serialize for RegionType
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 the GeoFRED token — symmetric with Deserialize.