pub trait PolygonTrait: Sized + GeometryTrait {
type RingType<'a>: 'a + LineStringTrait<T = <Self as GeometryTrait>::T>
where Self: 'a;
// Required methods
fn exterior(&self) -> Option<Self::RingType<'_>>;
fn num_interiors(&self) -> usize;
unsafe fn interior_unchecked(&self, i: usize) -> Self::RingType<'_>;
// Provided methods
fn interiors(
&self,
) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::RingType<'_>> { ... }
fn interior(&self, i: usize) -> Option<Self::RingType<'_>> { ... }
}
Expand description
A trait for accessing data from a generic Polygon.
A Polygon
’s outer boundary (exterior ring) is represented by a
LineString
. It may contain zero or more holes (interior rings), also
represented by LineString
s.
Refer to geo_types::Polygon for information about semantics and validity.
Required Associated Types§
Sourcetype RingType<'a>: 'a + LineStringTrait<T = <Self as GeometryTrait>::T>
where
Self: 'a
type RingType<'a>: 'a + LineStringTrait<T = <Self as GeometryTrait>::T> where Self: 'a
The coordinate type of this geometry The type of each underlying ring, which implements LineStringTrait
Required Methods§
Sourcefn num_interiors(&self) -> usize
fn num_interiors(&self) -> usize
The number of interior rings in this Polygon
Sourceunsafe fn interior_unchecked(&self, i: usize) -> Self::RingType<'_>
unsafe fn interior_unchecked(&self, i: usize) -> Self::RingType<'_>
Provided Methods§
Sourcefn interiors(
&self,
) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::RingType<'_>>
fn interiors( &self, ) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::RingType<'_>>
An iterator of the interior rings of this Polygon
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.