pub struct PathRequest {
pub start: Position,
pub end: Position,
pub constraints: PathConstraints,
pub(crate) alt_start: Option<(Position, Duration)>,
}
Fields
start: Position
end: Position
constraints: PathConstraints
alt_start: Option<(Position, Duration)>
Implementations
sourceimpl PathRequest
impl PathRequest
sourcepub fn between_buildings(
map: &Map,
from: BuildingID,
to: BuildingID,
constraints: PathConstraints
) -> Option<PathRequest>
pub fn between_buildings(
map: &Map,
from: BuildingID,
to: BuildingID,
constraints: PathConstraints
) -> Option<PathRequest>
Determines the start and end position to travel between two buildings for a certain mode. The path won’t cover modality transfers – if somebody has to walk between the building and a parking spot or bikeable position, that won’t be captured here.
sourcepub fn walking(start: Position, end: Position) -> PathRequest
pub fn walking(start: Position, end: Position) -> PathRequest
The caller must pass in two valid sidewalk positions. This isn’t verified.
sourcepub fn vehicle(
start: Position,
end: Position,
constraints: PathConstraints
) -> PathRequest
pub fn vehicle(
start: Position,
end: Position,
constraints: PathConstraints
) -> PathRequest
The caller must pass in two valid positions for the vehicle type. This isn’t verified. No off-side turns from driveways happen; the exact start position is used.
sourcepub fn leave_from_driveway(
start: Position,
end: Position,
constraints: PathConstraints,
map: &Map
) -> PathRequest
pub fn leave_from_driveway(
start: Position,
end: Position,
constraints: PathConstraints,
map: &Map
) -> PathRequest
The caller must pass in two valid positions for the vehicle type. This isn’t verified. TODO The vehicle may cut exit the driveway onto the off-side of the road.
sourcepub fn between_directed_roads(
map: &Map,
from: DirectedRoadID,
to: DirectedRoadID,
constraints: PathConstraints
) -> Option<PathRequest>
pub fn between_directed_roads(
map: &Map,
from: DirectedRoadID,
to: DirectedRoadID,
constraints: PathConstraints
) -> Option<PathRequest>
Create a request from the beginning of one road to the end of another. Picks an arbitrary start and end lane from the available ones.
sourcepub fn deduplicate(
map: &Map,
requests: Vec<PathRequest>
) -> Vec<(PathRequest, usize)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn deduplicate(
map: &Map,
requests: Vec<PathRequest>
) -> Vec<(PathRequest, usize)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Group similar requests together, returning the number of matches. This can be used to calculate less paths and multiply whatever’s being measured by the count.
Note this throws away detail. It only groups by the mode and from/to parent. Exact position and alternate starting points are lost.
Trait Implementations
sourceimpl Clone for PathRequest
impl Clone for PathRequest
sourcefn clone(&self) -> PathRequest
fn clone(&self) -> PathRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PathRequest
impl Debug for PathRequest
sourceimpl<'de> Deserialize<'de> for PathRequest
impl<'de> Deserialize<'de> for PathRequest
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
sourceimpl Display for PathRequest
impl Display for PathRequest
sourceimpl PartialEq<PathRequest> for PathRequest
impl PartialEq<PathRequest> for PathRequest
sourcefn eq(&self, other: &PathRequest) -> bool
fn eq(&self, other: &PathRequest) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PathRequest) -> bool
fn ne(&self, other: &PathRequest) -> bool
This method tests for !=
.
sourceimpl Serialize for PathRequest
impl Serialize for PathRequest
impl Eq for PathRequest
impl StructuralEq for PathRequest
impl StructuralPartialEq for PathRequest
Auto Trait Implementations
impl RefUnwindSafe for PathRequest
impl Send for PathRequest
impl Sync for PathRequest
impl Unpin for PathRequest
impl UnwindSafe for PathRequest
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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>
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