Trait MultiLineStringTrait

Source
pub trait MultiLineStringTrait: Sized + GeometryTrait {
    type InnerLineStringType<'a>: 'a + LineStringTrait<T = Self::T>
       where Self: 'a;

    // Required methods
    fn num_line_strings(&self) -> usize;
    unsafe fn line_string_unchecked(
        &self,
        i: usize,
    ) -> Self::InnerLineStringType<'_>;

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

A trait for accessing data from a generic MultiLineString.

A MultiLineString is a collection of LineStrings.

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

Required Associated Types§

Source

type InnerLineStringType<'a>: 'a + LineStringTrait<T = Self::T> where Self: 'a

The type of each underlying LineString, which implements LineStringTrait

Required Methods§

Source

fn num_line_strings(&self) -> usize

The number of line_strings in this MultiLineString

Source

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

Access to a specified line_string in this MultiLineString

§Safety

Accessing an index out of bounds is UB.

Provided Methods§

Source

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

An iterator over the LineStrings in this MultiLineString

Source

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

Access to a specified line_string in this MultiLineString 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> MultiLineStringTrait for &'a MultiLineString<T>

Source§

type InnerLineStringType<'b> = &'a LineString<<&'a MultiLineString<T> as GeometryTrait>::T> where Self: 'b

Source§

fn num_line_strings(&self) -> usize

Source§

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

Source§

impl<T: CoordNum> MultiLineStringTrait for MultiLineString<T>

Implementors§