use serde::{Deserialize, Serialize};
mod fun;
mod raw;
pub use self::fun::*;
round_trip! { raw::RawTrendLocation,
#[derive(Debug, Clone)]
pub struct TrendLocation {
pub country: String,
pub country_code: Option<String>,
pub name: String,
pub parentid: u32,
pub place_type: PlaceType,
pub url: String,
pub woeid: u32
}
}
impl From<raw::RawTrendLocation> for TrendLocation {
fn from(raw: raw::RawTrendLocation) -> TrendLocation {
TrendLocation {
country: raw.country,
country_code: raw.country_code,
name: raw.name,
parentid: raw.parentid,
place_type: raw.place_type,
url: raw.url,
woeid: raw.woeid,
}
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PlaceType {
pub code: u32,
pub name: String,
}