pub struct LineString {
pub coords: Vec<Coordinate>,
}Expand description
LineString geometry
Fields§
§coords: Vec<Coordinate>Coordinates of the line string
Implementations§
Source§impl LineString
impl LineString
Sourcepub fn new(coords: Vec<Coordinate>) -> Result<Self>
pub fn new(coords: Vec<Coordinate>) -> Result<Self>
Creates a new line string
Sourcepub fn push(&mut self, coord: Coordinate)
pub fn push(&mut self, coord: Coordinate)
Adds a coordinate to the line string
Sourcepub fn coords(&self) -> &[Coordinate]
pub fn coords(&self) -> &[Coordinate]
Returns a reference to the coordinates as a slice
Sourcepub fn points(&self) -> impl Iterator<Item = &Coordinate>
pub fn points(&self) -> impl Iterator<Item = &Coordinate>
Returns an iterator over the coordinates
Trait Implementations§
Source§impl Clone for LineString
impl Clone for LineString
Source§fn clone(&self) -> LineString
fn clone(&self) -> LineString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LineString
impl Debug for LineString
Source§impl<'de> Deserialize<'de> for LineString
impl<'de> Deserialize<'de> for LineString
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LineString
impl PartialEq for LineString
Source§impl Serialize for LineString
impl Serialize for LineString
impl StructuralPartialEq for LineString
Auto Trait Implementations§
impl Freeze for LineString
impl RefUnwindSafe for LineString
impl Send for LineString
impl Sync for LineString
impl Unpin for LineString
impl UnsafeUnpin for LineString
impl UnwindSafe for LineString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more