Skip to main content

MultiLinestring

Struct MultiLinestring 

Source
#[repr(transparent)]
pub struct MultiLinestring<L: LinestringTrait>(pub Vec<L>);
Expand description

Default MultiLinestring — a Vec<L> newtype where L is any concrete LinestringTrait implementor.

Mirrors boost::geometry::model::multi_linestring<LineString> from boost/geometry/geometries/multi_linestring.hpp:48-92. The #[repr(transparent)] annotation guarantees the in-memory layout matches the underlying Vec<L>, mirroring the invariant Boost relies on by inheriting publicly from std::vector<LineString> (boost/geometry/geometries/multi_linestring.hpp:55).

Tuple Fields§

§0: Vec<L>

Implementations§

Source§

impl<L: LinestringTrait> MultiLinestring<L>

Source

pub const fn new() -> Self

Construct an empty multi-linestring.

Mirrors the default multi_linestring() constructor at boost/geometry/geometries/multi_linestring.hpp:63-65.

Source

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

Wrap an existing Vec<L> as a multi-linestring without copying.

Rust analogue of the iterator-range multi_linestring(Iterator, Iterator) constructor at boost/geometry/geometries/multi_linestring.hpp:68-71.

Source

pub fn push(&mut self, ls: L)

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

Plays the role of std::vector::push_back on the inherited base_type in boost/geometry/geometries/multi_linestring.hpp:55-59.

Trait Implementations§

Source§

impl<L: Clone + LinestringTrait> Clone for MultiLinestring<L>

Source§

fn clone(&self) -> MultiLinestring<L>

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<L: Debug + LinestringTrait> Debug for MultiLinestring<L>

Source§

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

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

impl<L: LinestringTrait> Default for MultiLinestring<L>

Source§

fn default() -> Self

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

impl<L: LinestringTrait> Geometry for MultiLinestring<L>

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

Source§

type Kind = MultiLinestringTag

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

type Point = <L as Geometry>::Point

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

impl<L: LinestringTrait> MultiLinestring for MultiLinestring<L>

Wire the MultiLinestring concept up. The linestrings() iterator hands back self.0.iter()slice::Iter is already ExactSizeIterator. Plays the role of boost::begin(mls) / boost::end(mls) on model::multi_linestring (boost/geometry/geometries/multi_linestring.hpp:55-59).

Source§

type ItemLinestring = L

The element linestring type. Read more
Source§

fn linestrings(&self) -> impl ExactSizeIterator<Item = &L>

The linestrings of this multi-linestring, in declared order. Read more
Source§

impl<L: PartialEq + LinestringTrait> PartialEq for MultiLinestring<L>

Source§

fn eq(&self, other: &MultiLinestring<L>) -> 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 MultiLinestring<Linestring<Point<A, D, OldCs>>>

Source§

type Output = MultiLinestring<Linestring<Point<T, D, Cs>>>

The corresponding rebound stock model.
Source§

impl<L: PartialEq + LinestringTrait> StructuralPartialEq for MultiLinestring<L>

Auto Trait Implementations§

§

impl<L> Freeze for MultiLinestring<L>

§

impl<L> RefUnwindSafe for MultiLinestring<L>
where L: RefUnwindSafe,

§

impl<L> Send for MultiLinestring<L>
where L: Send,

§

impl<L> Sync for MultiLinestring<L>
where L: Sync,

§

impl<L> Unpin for MultiLinestring<L>
where L: Unpin,

§

impl<L> UnsafeUnpin for MultiLinestring<L>

§

impl<L> UnwindSafe for MultiLinestring<L>
where L: 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.