Struct map_model::traversable::Position
source · pub struct Position {
lane: LaneID,
dist_along: Distance,
}
Expand description
Represents a specific point some distance along a lane.
Fields§
§lane: LaneID
§dist_along: Distance
Implementations§
source§impl Position
impl Position
pub fn new(lane: LaneID, dist_along: Distance) -> Position
pub fn start(lane: LaneID) -> Position
pub fn end(lane: LaneID, map: &Map) -> Position
pub fn lane(&self) -> LaneID
pub fn dist_along(&self) -> Distance
pub fn pt(&self, map: &Map) -> Pt2D
pub fn pt_and_angle(&self, map: &Map) -> (Pt2D, Angle)
sourcepub fn equiv_pos(&self, lane: LaneID, map: &Map) -> Position
pub fn equiv_pos(&self, lane: LaneID, map: &Map) -> Position
Given a position along a lane, find the equivalent position along another lane on the same road.
pub fn equiv_pos_for_long_object( &self, other_lane: LaneID, object_length: Distance, map: &Map ) -> Position
pub fn min_dist(self, dist_along: Distance, map: &Map) -> Option<Position>
pub fn buffer_dist(self, buffer: Distance, map: &Map) -> Option<Position>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
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 Ord for Position
impl Ord for Position
source§impl PartialEq for Position
impl PartialEq for Position
source§impl PartialOrd for Position
impl PartialOrd for Position
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 moreimpl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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.