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