pub struct Slowdown { /* private fields */ }Expand description
Roads that take factor times as long to drive: every road of the listed
classes (every road when none is listed), only where they lie in area
when one is given. An edge lies in an area when its midpoint does.
Implementations§
Source§impl Slowdown
impl Slowdown
Sourcepub fn new(factor: f64) -> Result<Self, SlowdownError>
pub fn new(factor: f64) -> Result<Self, SlowdownError>
Every road taking factor times as long: 1.5 is half as long again,
0.8 is faster than usual.
Sourcepub fn roads(self, roads: impl IntoIterator<Item = RoadClass>) -> Self
pub fn roads(self, roads: impl IntoIterator<Item = RoadClass>) -> Self
Only roads of these classes.
Sourcepub fn area(self, area: BoundingBox) -> Self
pub fn area(self, area: BoundingBox) -> Self
Only roads inside area.
pub fn factor(&self) -> f64
Trait Implementations§
impl StructuralPartialEq for Slowdown
Auto Trait Implementations§
impl Forget for Slowdown
impl Freeze for Slowdown
impl Move for Slowdown
impl RefUnwindSafe for Slowdown
impl Send for Slowdown
impl Sync for Slowdown
impl Unpin for Slowdown
impl UnsafeUnpin for Slowdown
impl UnwindSafe for Slowdown
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more