B:BD[
2.3916] → [
2.3916:3966]
∅:D[
2.3966] → [
5.692:9799]
B:BD[
5.692] → [
5.692:9799]
B:BD[
5.9799] → [
2.3967:4351]
∅:D[
2.4351] → [
5.9799:11856]
B:BD[
5.9799] → [
5.9799:11856]
B:BD[
5.11856] → [
2.4352:4433]
dbg!(country);
dbg!(country.to_string());
let (exclude_phrase, include_phrase) = match country {
Country::Australia => {
(
vec!(
"Male",
"Female",
"55-64",
"25-54",
"15-24",
"20 to 24",
"Youth",
"Women",
"Teenagers",
),
vec!(
"Rate"
),
)
}
Country::Austria => {
(
vec!(
"Male",
"Female",
"55-64",
"25-54",
"15-24",
"15-64", // series includes 15-74
"20 to 24",
"Youth",
"Women",
"Teenagers",
),
vec!(
"Rate"
),
)
}
Country::Belgium => {
(
vec!(
"Male",
"Female",
"55-64",
"25-54",
"15-24",
"15-64", // series includes 15-74
"20 to 24",
"Youth",
"Women",
"Teenagers",
),
vec!(
"Rate"
),
)
}
Country::Canada => {
(
vec!(
"Male",
"Female",
"15-64",
"55-64",
"25-54",
"15-24",
"20 to 24",
"Youth",
"Women",
"Teenagers",
),
vec!(
"Rate"
),
)
}
Country::Chile => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate"
),
)
}
Country::CzechRepublic => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate"
),
)
}
Country::Denmark => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate"
),
)
}
Country::Estonia => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Finland => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::France => {
(
vec!(
"Male",
"Men",
"Female",
"Women",
"Youth",
"Teenagers",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Germany => {
(
vec!(
"Male",
"Men",
"Female",
"Youth",
"Women",
"Teenagers",
"20 to 24",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Greece => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Ireland => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Israel => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Italy => {
(
vec!(
"Male",
"Female",
"Youth",
"Men",
"Women",
"Teenagers",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Japan => {
(
vec!(
"Male",
"Female",
"Youth",
"Men",
"Women",
"Teenagers",
"20 to 24",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Latvia => {
(
vec!(
"Youth",
"Male",
"Female",
"25 and over",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"nemployment",
),
)
}
Country::Netherlands => {
(
vec!(
"Male",
"Female",
"Youth",
"Women",
"Teenagers",
"Men",
"20 to 24",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::NewZealand => {
(
vec!(
"Male",
"Female",
"55-64",
"25-54",
"15-24",
"Youth",
),
vec!(
"Rate",
),
)
}
Country::Norway => {
(
vec!(
"Male",
"Female",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Poland => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Serbia => {
(
vec!(
),
vec!(
"",
),
)
}
Country::SouthKorea => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Spain => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Sweden => {
(
vec!(
"Male",
"Female",
"Youth",
"Men",
"Women",
"Teenagers",
"15-24",
"15-64",
"25-54",
"55-64",
"20 to 24",
),
vec!(
"Rate",
),
)
}
Country::Switzerland => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::UnitedKingdom => {
(
vec!(
"Male",
"Female",
"Youth",
"Men",
"Women",
"Teenagers",
"20 to 24",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::UnitedStates => {
(
vec!(
"Male",
"Female",
),
vec!(
"Rate",
),
)
}
country => {
println!("{:?}", country);
panic!()
if let Country::UnitedStates = country {
// Need to use a different search technique for US data.
let exclude_phrase = vec!(
"Male",
"Female",
"Men",
"Women",
"Youth",
);
let one_of = vec!(
"Unemployment Rate for United States",
"Unemployment Rate: Aged 15 and Over: All Persons for the United States",
"Unemployment Rate: Aged 15-74: All Persons for the United States",
"Harmonized Unemployment Rate: Total: All Persons for the United States",
"Unemployment Rate - 18 Years and Over",
);
let tag_series = Fred::tags_series("unemployment;rate;usa;nation").unwrap().seriess;
tag_series
.exclude_phrases(exclude_phrase)
.equals_one_of(one_of)
} else {
let (exclude_phrase, include_phrase) = match country {
Country::Australia => {
(
vec!(
"Male",
"Female",
"55-64",
"25-54",
"15-24",
"20 to 24",
"Youth",
"Women",
"Teenagers",
),
vec!(
"Rate"
),
)
}
Country::Austria => {
(
vec!(
"Male",
"Female",
"55-64",
"25-54",
"15-24",
"15-64", // series includes 15-74
"20 to 24",
"Youth",
"Women",
"Teenagers",
),
vec!(
"Rate"
),
)
}
Country::Belgium => {
(
vec!(
"Male",
"Female",
"55-64",
"25-54",
"15-24",
"15-64", // series includes 15-74
"20 to 24",
"Youth",
"Women",
"Teenagers",
),
vec!(
"Rate"
),
)
}
Country::Canada => {
(
vec!(
"Male",
"Female",
"15-64",
"55-64",
"25-54",
"15-24",
"20 to 24",
"Youth",
"Women",
"Teenagers",
),
vec!(
"Rate"
),
)
}
Country::Chile => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate"
),
)
}
Country::CzechRepublic => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate"
),
)
}
Country::Denmark => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate"
),
)
}
Country::Estonia => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Finland => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::France => {
(
vec!(
"Male",
"Men",
"Female",
"Women",
"Youth",
"Teenagers",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Germany => {
(
vec!(
"Male",
"Men",
"Female",
"Youth",
"Women",
"Teenagers",
"20 to 24",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Greece => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Ireland => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Israel => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Italy => {
(
vec!(
"Male",
"Female",
"Youth",
"Men",
"Women",
"Teenagers",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Japan => {
(
vec!(
"Male",
"Female",
"Youth",
"Men",
"Women",
"Teenagers",
"20 to 24",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Latvia => {
(
vec!(
"Youth",
"Male",
"Female",
"25 and over",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"nemployment",
),
)
}
Country::Netherlands => {
(
vec!(
"Male",
"Female",
"Youth",
"Women",
"Teenagers",
"Men",
"20 to 24",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::NewZealand => {
(
vec!(
"Male",
"Female",
"55-64",
"25-54",
"15-24",
"Youth",
),
vec!(
"Rate",
),
)
}
Country::Norway => {
(
vec!(
"Male",
"Female",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Poland => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Serbia => {
(
vec!(
),
vec!(
"",
),
)
}
Country::SouthKorea => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Spain => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::Sweden => {
(
vec!(
"Male",
"Female",
"Youth",
"Men",
"Women",
"Teenagers",
"15-24",
"15-64",
"25-54",
"55-64",
"20 to 24",
),
vec!(
"Rate",
),
)
}
Country::Switzerland => {
(
vec!(
"Male",
"Female",
"Youth",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
Country::UnitedKingdom => {
(
vec!(
"Male",
"Female",
"Youth",
"Men",
"Women",
"Teenagers",
"20 to 24",
"15-24",
"15-64",
"25-54",
"55-64",
),
vec!(
"Rate",
),
)
}
_ => panic!(),
};
match Fred::tags_series(&to_tag("unemployment", country)) {
Ok(tags_series) => {
tags_series.seriess
.exclude_phrases(exclude_phrase)
.only_include(include_phrase)
},
Err(err) => {
println!("{}", err);
panic!();
},