pub struct Turn {
pub id: TurnID,
pub turn_type: TurnType,
pub geom: PolyLine,
}
Expand description
A Turn leads from the end of one Lane to the start of another. (Except for pedestrians; sidewalks are bidirectional.)
Fields§
§id: TurnID
§turn_type: TurnType
§geom: PolyLine
Implementations§
source§impl Turn
impl Turn
pub fn conflicts_with(&self, other: &Turn) -> bool
pub fn angle(&self) -> Angle
pub fn between_sidewalks(&self) -> bool
sourcepub fn penalty(
&self,
constraints: PathConstraints,
map: &Map
) -> (usize, usize, usize)
pub fn penalty( &self, constraints: PathConstraints, map: &Map ) -> (usize, usize, usize)
Penalties for (lane types, lane-changing, slow lane). The penalty may depend on the vehicle performing the turn. Lower means preferable.
pub fn is_crossing_arterial_intersection(&self, map: &Map) -> bool
sourcepub(crate) fn permitted_by_lane(&self, map: &Map) -> bool
pub(crate) fn permitted_by_lane(&self, map: &Map) -> bool
Is this turn legal, according to turn lane tagging?
sourcepub(crate) fn permitted_by_road(&self, i: &Intersection, map: &Map) -> bool
pub(crate) fn permitted_by_road(&self, i: &Intersection, map: &Map) -> bool
Is this turn legal, according to turn restrictions defined between road segments?
sourcepub fn crosswalk_over_road(&self, map: &Map) -> Option<DirectedRoadID>
pub fn crosswalk_over_road(&self, map: &Map) -> Option<DirectedRoadID>
If this turn is a crosswalk over a single road, return that road and which end of the road is crossed.
sourcepub fn crosswalk_line(&self) -> Option<Line>
pub fn crosswalk_line(&self) -> Option<Line>
Only appropriat for pedestrian crossings. The geometry of crosswalks will first cross part of a sidewalk corner, then actually enter the road. Extract the piece that’s in the road.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Turn
impl<'de> Deserialize<'de> for Turn
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 PartialEq for Turn
impl PartialEq for Turn
impl StructuralPartialEq for Turn
Auto Trait Implementations§
impl Freeze for Turn
impl RefUnwindSafe for Turn
impl Send for Turn
impl Sync for Turn
impl Unpin for Turn
impl UnwindSafe for Turn
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