Skip to main content

MultiPoint

Struct MultiPoint 

Source
#[repr(transparent)]
pub struct MultiPoint<P: PointTrait>(pub Vec<P>);
Expand description

Default MultiPoint — a Vec<P> newtype.

Mirrors boost::geometry::model::multi_point<Point> from boost/geometry/geometries/multi_point.hpp:52-100. The #[repr(transparent)] annotation guarantees the in-memory layout matches the underlying Vec<P>, mirroring the invariant Boost relies on by inheriting publicly from std::vector<Point> (boost/geometry/geometries/multi_point.hpp:58).

Tuple Fields§

§0: Vec<P>

Implementations§

Source§

impl<P: PointTrait> MultiPoint<P>

Source

pub const fn new() -> Self

Construct an empty multi-point.

Mirrors the default multi_point() constructor at boost/geometry/geometries/multi_point.hpp:66-68.

Source

pub const fn from_vec(v: Vec<P>) -> Self

Wrap an existing Vec<P> as a multi-point without copying.

Rust analogue of the iterator-range multi_point(Iterator, Iterator) constructor at boost/geometry/geometries/multi_point.hpp:71-74; the Vec is moved in rather than copied element-by-element.

Source

pub fn push(&mut self, p: P)

Append a point to the back of the multi-point.

Plays the role of std::vector::push_back on the inherited base_type in boost/geometry/geometries/multi_point.hpp:58-62.

Trait Implementations§

Source§

impl<P: Clone + PointTrait> Clone for MultiPoint<P>

Source§

fn clone(&self) -> MultiPoint<P>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug + PointTrait> Debug for MultiPoint<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: PointTrait> Default for MultiPoint<P>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<P: PointTrait> Geometry for MultiPoint<P>

Tag this concrete type as a MultiPoint. Mirrors the traits::tag<model::multi_point<...>> specialisation at boost/geometry/geometries/multi_point.hpp:101-115.

Source§

type Kind = MultiPointTag

One of the *Tag types from geometry_tag. Read more
Source§

type Point = P

The point type this geometry is built from. For a value modelling Point, this is Self. Read more
Source§

impl<P: PointTrait> MultiPoint for MultiPoint<P>

Wire the MultiPoint concept up. The points() iterator hands back self.0.iter()slice::Iter is already ExactSizeIterator. Plays the role of boost::begin(mp) / boost::end(mp) on model::multi_point (boost/geometry/geometries/multi_point.hpp:58-62).

Source§

type ItemPoint = P

The element point type. Read more
Source§

fn points(&self) -> impl ExactSizeIterator<Item = &P>

The points of this multi-point, in declared order. Read more
Source§

impl<P: PartialEq + PointTrait> PartialEq for MultiPoint<P>

Source§

fn eq(&self, other: &MultiPoint<P>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<A, const D: usize, OldCs, T, Cs> RebindGeometry<T, Cs> for MultiPoint<Point<A, D, OldCs>>

Source§

type Output = MultiPoint<Point<T, D, Cs>>

The corresponding rebound stock model.
Source§

impl<P: PartialEq + PointTrait> StructuralPartialEq for MultiPoint<P>

Auto Trait Implementations§

§

impl<P> Freeze for MultiPoint<P>

§

impl<P> RefUnwindSafe for MultiPoint<P>
where P: RefUnwindSafe,

§

impl<P> Send for MultiPoint<P>
where P: Send,

§

impl<P> Sync for MultiPoint<P>
where P: Sync,

§

impl<P> Unpin for MultiPoint<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for MultiPoint<P>

§

impl<P> UnwindSafe for MultiPoint<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SameAs<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.