pub struct MapData {
pub name: String,
pub regions: Vec<MapRegion>,
pub bounds: GeoBounds,
}Expand description
One map: the regions it is made of, and the box they cover.
Fields§
§name: StringThe name the map is registered under.
regions: Vec<MapRegion>The regions of the map.
bounds: GeoBoundsThe box the regions cover.
Implementations§
Source§impl MapData
Inherent implementation of MapData.
impl MapData
Inherent implementation of MapData.
Sourcepub fn from_regions(name: &str, regions: Vec<MapRegion>) -> Self
pub fn from_regions(name: &str, regions: Vec<MapRegion>) -> Self
Builds a map out of its regions, and measures the box they cover.
§Arguments
&str- Shared reference to astr.Vec<MapRegion>- AVec<MapRegion>parameter.
Sourcepub fn from_geojson(name: &str, value: &DataValue) -> Result<Self, GeoError>
pub fn from_geojson(name: &str, value: &DataValue) -> Result<Self, GeoError>
Reads a GeoJSON document into a map.
The document is the shape GeoJSON has: a collection of features,
each with a geometry and a name. The name is taken from the
name property of the feature, because that is where GeoJSON
keeps it.
§Arguments
&str- Shared reference to astr.&DataValue- Shared reference to aDataValue.
§Returns
Result<Self, GeoError>- Result of the operation; anErrvariant on failure.
Source§impl MapData
impl MapData
pub fn get_name(&self) -> &String
pub fn get_mut_name(&mut self) -> &mut String
pub fn set_name(&mut self, val: String) -> &mut Self
pub fn get_regions(&self) -> &Vec<MapRegion>
pub fn get_mut_regions(&mut self) -> &mut Vec<MapRegion>
pub fn set_regions(&mut self, val: Vec<MapRegion>) -> &mut Self
pub fn get_bounds(&self) -> &GeoBounds
pub fn get_mut_bounds(&mut self) -> &mut GeoBounds
pub fn set_bounds(&mut self, val: GeoBounds) -> &mut Self
Trait Implementations§
impl StructuralPartialEq for MapData
Auto Trait Implementations§
impl Freeze for MapData
impl RefUnwindSafe for MapData
impl Send for MapData
impl Sync for MapData
impl Unpin for MapData
impl UnsafeUnpin for MapData
impl UnwindSafe for MapData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more