pub trait MultiPolygonTrait: Sized + GeometryTrait {
type InnerPolygonType<'a>: 'a + PolygonTrait<T = Self::T>
where Self: 'a;
// Required methods
fn num_polygons(&self) -> usize;
unsafe fn polygon_unchecked(&self, i: usize) -> Self::InnerPolygonType<'_>;
// Provided methods
fn polygons(
&self,
) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::InnerPolygonType<'_>> { ... }
fn polygon(&self, i: usize) -> Option<Self::InnerPolygonType<'_>> { ... }
}
Expand description
A trait for accessing data from a generic MultiPolygon.
Refer to geo_types::MultiPolygon for information about semantics and validity.
Required Associated Types§
Sourcetype InnerPolygonType<'a>: 'a + PolygonTrait<T = Self::T>
where
Self: 'a
type InnerPolygonType<'a>: 'a + PolygonTrait<T = Self::T> where Self: 'a
The type of each underlying Polygon, which implements PolygonTrait
Required Methods§
Sourcefn num_polygons(&self) -> usize
fn num_polygons(&self) -> usize
The number of polygons in this MultiPolygon
Sourceunsafe fn polygon_unchecked(&self, i: usize) -> Self::InnerPolygonType<'_>
unsafe fn polygon_unchecked(&self, i: usize) -> Self::InnerPolygonType<'_>
Provided Methods§
Sourcefn polygons(
&self,
) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::InnerPolygonType<'_>>
fn polygons( &self, ) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::InnerPolygonType<'_>>
An iterator over the Polygons in this MultiPolygon
Sourcefn polygon(&self, i: usize) -> Option<Self::InnerPolygonType<'_>>
fn polygon(&self, i: usize) -> Option<Self::InnerPolygonType<'_>>
Access to a specified polygon in this MultiPolygon Will return None if the provided index is out of bounds
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.