Fields
lt: LaneType
dir: Direction
width: Distance
Implementations
impl LaneSpec
impl LaneSpec
pub fn maybe_add_bike_lanes(
lanes_ltr: &mut Vec<LaneSpec, Global>,
buffer_type: Option<BufferType>,
driving_side: DrivingSide
)
impl LaneSpec
impl LaneSpec
pub fn add_new_lane(
lanes_ltr: &mut Vec<LaneSpec, Global>,
lt: LaneType,
osm_tags: &Tags,
driving_side: DrivingSide
) -> usize
pub fn add_new_lane(
lanes_ltr: &mut Vec<LaneSpec, Global>,
lt: LaneType,
osm_tags: &Tags,
driving_side: DrivingSide
) -> usize
Returns the index where the new lane was inserted
impl LaneSpec
impl LaneSpec
pub fn toggle_road_direction(
lanes_ltr: &mut Vec<LaneSpec, Global>,
driving_side: DrivingSide
)
pub fn toggle_road_direction(
lanes_ltr: &mut Vec<LaneSpec, Global>,
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.
impl LaneSpec
impl LaneSpec
pub fn create_for_test(input_lt: &str, input_dir: &str) -> Vec<LaneSpec, Global>ⓘ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, Global>ⓘ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.
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
)
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.
impl LaneSpec
impl LaneSpec
pub fn typical_lane_widths(
lt: LaneType,
tags: &Tags
) -> Vec<(Distance, &'static str), Global>ⓘ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), Global>ⓘ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.
Trait Implementations
impl<'de> Deserialize<'de> for LaneSpec
impl<'de> Deserialize<'de> for LaneSpec
fn deserialize<__D>(
__deserializer: __D
) -> Result<LaneSpec, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<LaneSpec, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Serialize for LaneSpec
impl Serialize for LaneSpec
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. 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