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
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for Turn
impl<'de> Deserialize<'de> for Turn
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
impl StructuralPartialEq for Turn
Auto Trait Implementations
impl RefUnwindSafe for Turn
impl Send for Turn
impl Sync for Turn
impl Unpin for Turn
impl UnwindSafe for Turn
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more