#[repr(transparent)]pub struct Linestring<P: PointTrait>(pub Vec<P>);Expand description
Default Linestring — a Vec<P> newtype.
Mirrors boost::geometry::model::linestring<Point> from
boost/geometry/geometries/linestring.hpp:54-95. The
#[repr(transparent)] annotation guarantees the in-memory layout
matches the underlying Vec<P>, so callers can safely transmute
between the two when interfacing with code that already operates
on Vec<P> directly — the same invariant Boost relies on by
inheriting publicly from std::vector<Point>.
Tuple Fields§
§0: Vec<P>Implementations§
Source§impl<P: PointTrait> Linestring<P>
impl<P: PointTrait> Linestring<P>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Construct an empty linestring.
Mirrors the default linestring() constructor at
boost/geometry/geometries/linestring.hpp:68-70.
Trait Implementations§
Source§impl<P: Clone + PointTrait> Clone for Linestring<P>
impl<P: Clone + PointTrait> Clone for Linestring<P>
Source§fn clone(&self) -> Linestring<P>
fn clone(&self) -> Linestring<P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<P: Debug + PointTrait> Debug for Linestring<P>
impl<P: Debug + PointTrait> Debug for Linestring<P>
Source§impl<P: PointTrait> Default for Linestring<P>
impl<P: PointTrait> Default for Linestring<P>
Source§impl<P: PointTrait> Geometry for Linestring<P>
Tag this concrete type as a Linestring. Mirrors the
traits::tag<model::linestring<...>> specialisation at
boost/geometry/geometries/linestring.hpp:103-113.
impl<P: PointTrait> Geometry for Linestring<P>
Tag this concrete type as a Linestring. Mirrors the
traits::tag<model::linestring<...>> specialisation at
boost/geometry/geometries/linestring.hpp:103-113.
Source§impl<P: PointTrait> Linestring for Linestring<P>
Wire the Linestring concept up. The points() iterator hands back
self.0.iter() — slice::Iter is already
ExactSizeIterator + Clone, so no adapter is needed. Plays the
role of boost::begin(ls) / boost::end(ls) on
model::linestring (boost/geometry/geometries/linestring.hpp:60-64).
impl<P: PointTrait> Linestring for Linestring<P>
Wire the Linestring concept up. The points() iterator hands back
self.0.iter() — slice::Iter is already
ExactSizeIterator + Clone, so no adapter is needed. Plays the
role of boost::begin(ls) / boost::end(ls) on
model::linestring (boost/geometry/geometries/linestring.hpp:60-64).