Coords

Struct Coords 

Source
pub struct Coords { /* private fields */ }
Expand description

Represent a list of coordinates. For each pair, the first float is the longitude, or x, and the second is the latitude, or y.

Implementations§

Source§

impl<'a> Coords

Source

pub unsafe fn from_bytes(data: &'a [u8]) -> &'a Self

§Safety

The data must contains and even number of f64 and be aligned on 64 bits.

Source

pub unsafe fn from_slice(data: &[f64]) -> &Self

§Safety

The data must contain an even number of f64.

Source

pub unsafe fn from_slice_mut(data: &mut [f64]) -> &mut Self

§Safety

The data must contain an even number of f64.

Source

pub fn len(&self) -> usize

Return the number of crate::Coords stored.

Source

pub fn is_empty(&self) -> bool

Return true if it doesn’t contains anything.

Source

pub fn iter(&self) -> impl Iterator<Item = &Coord>

Return the individual crate::Coords.

Source

pub fn consecutive_pairs(&self) -> impl Iterator<Item = &[f64]>

Return all the consecutive pairs of crate::Coords.

Trait Implementations§

Source§

impl Debug for Coords

Source§

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

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

impl Index<usize> for Coords

Source§

type Output = Coord

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl Freeze for Coords

§

impl RefUnwindSafe for Coords

§

impl Send for Coords

§

impl !Sized for Coords

§

impl Sync for Coords

§

impl Unpin for Coords

§

impl UnwindSafe for Coords

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