pub struct MapRegion {
pub name: String,
pub polygons: Vec<RegionPolygon>,
}Expand description
One region of a map.
The name of the region is what the series’ data is matched against: a data item whose name is the name of a region gives that region its value.
Fields§
§name: StringThe name of the region.
polygons: Vec<RegionPolygon>The outlines of the region.
Implementations§
Source§impl MapRegion
Inherent implementation of MapRegion.
impl MapRegion
Inherent implementation of MapRegion.
Sourcepub fn center(&self) -> Option<GeoPoint>
pub fn center(&self) -> Option<GeoPoint>
Returns the middle of the region, in geographic coordinates.
The middle is the centre of gravity of the outline, which is where a label of the region belongs. A region without a usable outline has no middle.
§Returns
Option<GeoPoint>-Some(...)on success,Noneotherwise.
Source§impl MapRegion
impl MapRegion
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_polygons(&self) -> &Vec<RegionPolygon>
pub fn get_mut_polygons(&mut self) -> &mut Vec<RegionPolygon>
pub fn set_polygons(&mut self, val: Vec<RegionPolygon>) -> &mut Self
Trait Implementations§
impl StructuralPartialEq for MapRegion
Auto Trait Implementations§
impl Freeze for MapRegion
impl RefUnwindSafe for MapRegion
impl Send for MapRegion
impl Sync for MapRegion
impl Unpin for MapRegion
impl UnsafeUnpin for MapRegion
impl UnwindSafe for MapRegion
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