Trait MultiPointTrait

Source
pub trait MultiPointTrait: Sized + GeometryTrait {
    type InnerPointType<'a>: 'a + PointTrait<T = Self::T>
       where Self: 'a;

    // Required methods
    fn num_points(&self) -> usize;
    unsafe fn point_unchecked(&self, i: usize) -> Self::InnerPointType<'_>;

    // Provided methods
    fn points(
        &self,
    ) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::InnerPointType<'_>> { ... }
    fn point(&self, i: usize) -> Option<Self::InnerPointType<'_>> { ... }
}
Expand description

A trait for accessing data from a generic MultiPoint.

A MultiPoint is a collection of Points.

Refer to geo_types::MultiPoint for information about semantics and validity.

Required Associated Types§

Source

type InnerPointType<'a>: 'a + PointTrait<T = Self::T> where Self: 'a

The type of each underlying Point, which implements PointTrait

Required Methods§

Source

fn num_points(&self) -> usize

The number of points in this MultiPoint

Source

unsafe fn point_unchecked(&self, i: usize) -> Self::InnerPointType<'_>

Access to a specified point in this MultiPoint

§Safety

Accessing an index out of bounds is UB.

Provided Methods§

Source

fn points( &self, ) -> impl DoubleEndedIterator + ExactSizeIterator<Item = Self::InnerPointType<'_>>

An iterator over the points in this MultiPoint

Source

fn point(&self, i: usize) -> Option<Self::InnerPointType<'_>>

Access to a specified point in this MultiPoint 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.

Implementations on Foreign Types§

Source§

impl<'a, T: CoordNum> MultiPointTrait for &'a MultiPoint<T>

Source§

type InnerPointType<'b> = &'a Point<<&'a MultiPoint<T> as GeometryTrait>::T> where Self: 'b

Source§

fn num_points(&self) -> usize

Source§

unsafe fn point_unchecked(&self, i: usize) -> Self::InnerPointType<'_>

Source§

impl<T: CoordNum> MultiPointTrait for MultiPoint<T>

Source§

type InnerPointType<'a> = &'a Point<<MultiPoint<T> as GeometryTrait>::T> where Self: 'a

Source§

fn num_points(&self) -> usize

Source§

unsafe fn point_unchecked(&self, i: usize) -> Self::InnerPointType<'_>

Implementors§