pub trait GeometryCollectionTrait: Sized + GeometryTrait {
type GeometryType<'a>: 'a + GeometryTrait<T = Self::T>
where Self: 'a;
// Required methods
fn num_geometries(&self) -> usize;
unsafe fn geometry_unchecked(&self, i: usize) -> Self::GeometryType<'_>;
// Provided methods
fn geometries(
&self,
) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::GeometryType<'_>> { ... }
fn geometry(&self, i: usize) -> Option<Self::GeometryType<'_>> { ... }
}
Expand description
A trait for accessing data from a generic GeometryCollection.
A GeometryCollection is a collection of Geometry types.
Required Associated Types§
Sourcetype GeometryType<'a>: 'a + GeometryTrait<T = Self::T>
where
Self: 'a
type GeometryType<'a>: 'a + GeometryTrait<T = Self::T> where Self: 'a
The type of each underlying geometry, which implements GeometryTrait
Required Methods§
Sourcefn num_geometries(&self) -> usize
fn num_geometries(&self) -> usize
The number of geometries in this GeometryCollection
Sourceunsafe fn geometry_unchecked(&self, i: usize) -> Self::GeometryType<'_>
unsafe fn geometry_unchecked(&self, i: usize) -> Self::GeometryType<'_>
Access to a specified geometry in this GeometryCollection
§Safety
Accessing an index out of bounds is UB.
Provided Methods§
Sourcefn geometries(
&self,
) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::GeometryType<'_>>
fn geometries( &self, ) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::GeometryType<'_>>
An iterator over the geometries in this GeometryCollection
Sourcefn geometry(&self, i: usize) -> Option<Self::GeometryType<'_>>
fn geometry(&self, i: usize) -> Option<Self::GeometryType<'_>>
Access to a specified geometry in this GeometryCollection 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.