Struct street_network::LaneSpec
source · [−]Fields
lt: LaneType
dir: Direction
width: Distance
Implementations
sourceimpl LaneSpec
impl LaneSpec
pub fn maybe_add_bike_lanes(
lanes_ltr: &mut Vec<LaneSpec>,
buffer_type: Option<BufferType>,
driving_side: DrivingSide
)
sourceimpl LaneSpec
impl LaneSpec
sourcepub fn add_new_lane(
lanes_ltr: &mut Vec<LaneSpec>,
lt: LaneType,
osm_tags: &Tags,
driving_side: DrivingSide
) -> usize
pub fn add_new_lane(
lanes_ltr: &mut Vec<LaneSpec>,
lt: LaneType,
osm_tags: &Tags,
driving_side: DrivingSide
) -> usize
Returns the index where the new lane was inserted
sourceimpl LaneSpec
impl LaneSpec
sourcepub fn toggle_road_direction(
lanes_ltr: &mut Vec<LaneSpec>,
driving_side: DrivingSide
)
pub fn toggle_road_direction(
lanes_ltr: &mut Vec<LaneSpec>,
driving_side: DrivingSide
)
Convert the driving lanes of a road between one-way forwards, one-way backwards, and bidirectional. It should be idempotent to apply this 3 times in a row. Even when an existing one-way street is narrow, it can be made bidirectional by splitting into two very narrow lanes.
sourceimpl LaneSpec
impl LaneSpec
sourcepub fn create_for_test(input_lt: &str, input_dir: &str) -> Vec<LaneSpec>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn create_for_test(input_lt: &str, input_dir: &str) -> Vec<LaneSpec>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Transforms a string describing lane types and directions, like “spddps” and “vv^^^^^”, into a list of LaneSpecs. Useful for unit tests.
sourcepub fn check_lanes_ltr(
actual_lanes_ltr: &[LaneSpec],
description: String,
input_lt: &str,
input_dir: &str,
expected_lt: &str,
expected_dir: &str,
ok: &mut bool
)
pub fn check_lanes_ltr(
actual_lanes_ltr: &[LaneSpec],
description: String,
input_lt: &str,
input_dir: &str,
expected_lt: &str,
expected_dir: &str,
ok: &mut bool
)
This is meant for table-driven unit tests. Call this on the transformed / output lanes. If
the lanes don’t match, ok
will be set to false and appropriate errors will be printed.
sourceimpl LaneSpec
impl LaneSpec
sourcepub fn typical_lane_widths(
lt: LaneType,
tags: &Tags
) -> Vec<(Distance, &'static str)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn typical_lane_widths(
lt: LaneType,
tags: &Tags
) -> Vec<(Distance, &'static str)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
For a given lane type, returns some likely widths. This may depend on the type of the road, so the OSM tags are also passed in. The first value returned will be used as a default.
sourcepub(crate) fn assemble_ltr(
fwd_side: Vec<LaneSpec>,
back_side: Vec<LaneSpec>,
driving_side: DrivingSide
) -> Vec<LaneSpec>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub(crate) fn assemble_ltr(
fwd_side: Vec<LaneSpec>,
back_side: Vec<LaneSpec>,
driving_side: DrivingSide
) -> Vec<LaneSpec>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Put a list of forward and backward lanes into left-to-right order, depending on the driving side. Both input lists should be ordered from the center of the road going outwards.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for LaneSpec
impl<'de> Deserialize<'de> for LaneSpec
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 LaneSpec
Auto Trait Implementations
impl RefUnwindSafe for LaneSpec
impl Send for LaneSpec
impl Sync for LaneSpec
impl Unpin for LaneSpec
impl UnwindSafe for LaneSpec
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<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