[][src]Enum vrp_pragmatic::format::Location

pub enum Location {
    Coordinate {
        lat: f64,
        lng: f64,
    },
    Reference {
        index: usize,
    },
}

Represents a location type.

Variants

Coordinate

A location type represented by geocoordinate with latitude and longitude.

Fields of Coordinate

lat: f64

Latitude.

lng: f64

Longitude.

Reference

A location type represented by index reference in routing matrix.

Fields of Reference

index: usize

An index in routing matrix.

Implementations

impl Location[src]

pub fn new_coordinate(lat: f64, lng: f64) -> Self[src]

Creates a new [Location] as coordinate.

pub fn new_reference(index: usize) -> Self[src]

Creates a new [Location] as index reference.

pub fn to_lat_lng(&self) -> (f64, f64)[src]

Returns lat lng if location is coordinate, panics otherwise.

Trait Implementations

impl Clone for Location[src]

impl Debug for Location[src]

impl<'de> Deserialize<'de> for Location[src]

impl Display for Location[src]

impl Eq for Location[src]

impl Hash for Location[src]

impl PartialEq<Location> for Location[src]

impl Serialize for Location[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,