use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FeatureCollection {
#[serde(rename = "features")]
pub features: Vec<models::Feature>,
#[serde(rename = "type")]
pub r#type: Type,
}
impl FeatureCollection {
pub fn new(features: Vec<models::Feature>, r#type: Type) -> FeatureCollection {
FeatureCollection {
features,
r#type,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "FeatureCollection")]
FeatureCollection,
}
impl Default for Type {
fn default() -> Type {
Self::FeatureCollection
}
}