Struct map_model::pathfind::v2::PathV2[][src]

pub struct PathV2 {
    steps: Vec<PathStepV2>,
    req: PathRequest,
    cost: Duration,
    uber_turns: Vec<UberTurnV2>,
}

A path between two endpoints for a particular mode. This representation is immutable and doesn't prescribe specific lanes and turns to follow.

Fields

steps: Vec<PathStepV2>req: PathRequestcost: Durationuber_turns: Vec<UberTurnV2>

Implementations

impl PathV2[src]

pub(crate) fn new(
    steps: Vec<PathStepV2>,
    req: PathRequest,
    cost: Duration,
    uber_turns: Vec<UberTurnV2>
) -> PathV2
[src]

pub(crate) fn from_roads(
    roads: Vec<DirectedRoadID>,
    req: PathRequest,
    cost: Duration,
    uber_turns: Vec<UberTurnV2>,
    map: &Map
) -> PathV2
[src]

Vehicle implementations often just calculate the sequence of roads. Turn that into PathStepV2 here.

pub fn get_req(&self) -> &PathRequest[src]

The original PathRequest used to produce this path.

pub fn get_steps(&self) -> &Vec<PathStepV2>[src]

All steps in this path.

pub fn get_cost(&self) -> Duration[src]

The time needed to perform this path. This time is not a lower bound; physically following the path might be faster. This time incorporates costs like using sub-optimal lanes or taking difficult turns.

pub fn to_v1(self, map: &Map) -> Result<Path>[src]

Transform a sequence of roads representing a path into the current lane-based path, by picking particular lanes and turns to use.

fn to_v1_walking(self, map: &Map) -> Result<Path>[src]

Trait Implementations

impl Clone for PathV2[src]

impl Debug for PathV2[src]

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

impl Serialize for PathV2[src]

Auto Trait Implementations

impl RefUnwindSafe for PathV2[src]

impl Send for PathV2[src]

impl Sync for PathV2[src]

impl Unpin for PathV2[src]

impl UnwindSafe for PathV2[src]

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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>,