pub struct PathV2 {
steps: Vec<PathStepV2>,
req: PathRequest,
cost: Duration,
uber_turns: Vec<UberTurnV2>,
}
Expand description
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: PathRequest
cost: Duration
uber_turns: Vec<UberTurnV2>
Implementations
sourceimpl PathV2
impl PathV2
pub(crate) fn new(
steps: Vec<PathStepV2>,
req: PathRequest,
cost: Duration,
uber_turns: Vec<UberTurnV2>
) -> PathV2
sourcepub fn from_roads(
roads: Vec<DirectedRoadID>,
req: PathRequest,
cost: Duration,
uber_turns: Vec<UberTurnV2>,
map: &Map
) -> PathV2
pub fn from_roads(
roads: Vec<DirectedRoadID>,
req: PathRequest,
cost: Duration,
uber_turns: Vec<UberTurnV2>,
map: &Map
) -> PathV2
Vehicle implementations often just calculate the sequence of roads. Turn that into PathStepV2 here.
sourcepub fn get_req(&self) -> &PathRequest
pub fn get_req(&self) -> &PathRequest
The original PathRequest used to produce this path.
sourcepub fn get_steps(&self) -> &Vec<PathStepV2>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_steps(&self) -> &Vec<PathStepV2>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
All steps in this path.
sourcepub fn get_cost(&self) -> Duration
pub fn get_cost(&self) -> Duration
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.
sourcepub fn into_v1(self, map: &Map) -> Result<Path>
pub fn into_v1(self, map: &Map) -> Result<Path>
Transform a sequence of roads representing a path into the current lane-based path, by picking particular lanes and turns to use.
fn into_v1_walking(self, map: &Map) -> Result<Path>
pub fn crosses_road(&self, r: RoadID) -> bool
Trait Implementations
sourceimpl<'de> Deserialize<'de> for PathV2
impl<'de> Deserialize<'de> for PathV2
sourcefn 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
Auto Trait Implementations
impl RefUnwindSafe for PathV2
impl Send for PathV2
impl Sync for PathV2
impl Unpin for PathV2
impl UnwindSafe for PathV2
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more