use serde::{Deserialize, Serialize}; use crate::json; use super::{circle::Circle, polygon::Polygon, text::Text}; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct Area { pub description: Text, pub regions: Vec, pub polygons: Vec, pub circles: Vec, } impl From for Area { fn from(value: json::area::Area) -> Self { Self { description: value.description.into(), regions: value.regions.into_iter().map(|x| x.region).collect(), polygons: value.polygons.into_iter().map(|x| x.into()).collect(), circles: value.circles.into_iter().map(|x| x.into()).collect(), } } }