Enum map_model::traversable::Traversable
source · pub enum Traversable {
Lane(LaneID),
Turn(TurnID),
}
Expand description
Either a lane or a turn, where most movement happens.
Variants§
Implementations§
source§impl Traversable
impl Traversable
pub fn as_lane(&self) -> LaneID
pub fn as_turn(&self) -> TurnID
pub fn maybe_turn(&self) -> Option<TurnID>
pub fn maybe_lane(&self) -> Option<LaneID>
sourcepub fn get_polyline(self, map: &Map) -> &PolyLine
pub fn get_polyline(self, map: &Map) -> &PolyLine
Return the center-line geometry of this lane or turn.
pub fn get_zorder(&self, map: &Map) -> isize
sourcepub(crate) fn max_speed_along_road(
dr: DirectedRoadID,
max_speed_on_flat_ground: Option<Speed>,
constraints: PathConstraints,
map: &Map
) -> (Speed, f64)
pub(crate) fn max_speed_along_road( dr: DirectedRoadID, max_speed_on_flat_ground: Option<Speed>, constraints: PathConstraints, map: &Map ) -> (Speed, f64)
The single definitive place to determine how fast somebody could go along a single road. This should be used for pathfinding and simulation. Returns (speed, percent incline).
sourcepub(crate) fn max_speed_along_movement(
mvmnt: MovementID,
max_speed_on_flat_ground: Option<Speed>,
_: PathConstraints,
map: &Map
) -> Speed
pub(crate) fn max_speed_along_movement( mvmnt: MovementID, max_speed_on_flat_ground: Option<Speed>, _: PathConstraints, map: &Map ) -> Speed
The single definitive place to determine how fast somebody could go along a single movement. This should be used for pathfinding and simulation. Ignores elevation.
Trait Implementations§
source§impl Clone for Traversable
impl Clone for Traversable
source§fn clone(&self) -> Traversable
fn clone(&self) -> Traversable
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Traversable
impl Debug for Traversable
source§impl<'de> Deserialize<'de> for Traversable
impl<'de> Deserialize<'de> for Traversable
source§fn 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
source§impl Display for Traversable
impl Display for Traversable
source§impl Hash for Traversable
impl Hash for Traversable
source§impl Ord for Traversable
impl Ord for Traversable
source§fn cmp(&self, other: &Traversable) -> Ordering
fn cmp(&self, other: &Traversable) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for Traversable
impl PartialEq for Traversable
source§fn eq(&self, other: &Traversable) -> bool
fn eq(&self, other: &Traversable) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Traversable
impl PartialOrd for Traversable
source§fn partial_cmp(&self, other: &Traversable) -> Option<Ordering>
fn partial_cmp(&self, other: &Traversable) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Traversable
impl Serialize for Traversable
impl Copy for Traversable
impl Eq for Traversable
impl StructuralPartialEq for Traversable
Auto Trait Implementations§
impl Freeze for Traversable
impl RefUnwindSafe for Traversable
impl Send for Traversable
impl Sync for Traversable
impl Unpin for Traversable
impl UnwindSafe for Traversable
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.