#[non_exhaustive]pub struct LoadLimit {
pub max_load: Option<i64>,
pub soft_max_load: i64,
pub cost_per_unit_above_soft_max: f64,
pub start_load_interval: Option<Interval>,
pub end_load_interval: Option<Interval>,
}Expand description
Defines a load limit applying to a vehicle, e.g. “this truck may only carry up to 3500 kg”. See load_limits.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_load: Option<i64>The maximum acceptable amount of load.
soft_max_load: i64A soft limit of the load. See cost_per_unit_above_soft_max.
cost_per_unit_above_soft_max: f64If the load ever exceeds soft_max_load along this vehicle’s route, the following cost penalty applies (only once per vehicle): (load - soft_max_load)
- cost_per_unit_above_soft_max. All costs add up and must be in the same unit as Shipment.penalty_cost.
start_load_interval: Option<Interval>The acceptable load interval of the vehicle at the start of the route.
end_load_interval: Option<Interval>The acceptable load interval of the vehicle at the end of the route.
Implementations§
Source§impl LoadLimit
impl LoadLimit
pub fn new() -> Self
Sourcepub fn set_soft_max_load<T: Into<i64>>(self, v: T) -> Self
pub fn set_soft_max_load<T: Into<i64>>(self, v: T) -> Self
Sets the value of soft_max_load.
Sourcepub fn set_cost_per_unit_above_soft_max<T: Into<f64>>(self, v: T) -> Self
pub fn set_cost_per_unit_above_soft_max<T: Into<f64>>(self, v: T) -> Self
Sets the value of cost_per_unit_above_soft_max.
Sourcepub fn set_start_load_interval<T: Into<Option<Interval>>>(self, v: T) -> Self
pub fn set_start_load_interval<T: Into<Option<Interval>>>(self, v: T) -> Self
Sets the value of start_load_interval.
Sourcepub fn set_end_load_interval<T: Into<Option<Interval>>>(self, v: T) -> Self
pub fn set_end_load_interval<T: Into<Option<Interval>>>(self, v: T) -> Self
Sets the value of end_load_interval.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LoadLimit
impl<'de> Deserialize<'de> for LoadLimit
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 Message for LoadLimit
impl Message for LoadLimit
impl StructuralPartialEq for LoadLimit
Auto Trait Implementations§
impl Freeze for LoadLimit
impl RefUnwindSafe for LoadLimit
impl Send for LoadLimit
impl Sync for LoadLimit
impl Unpin for LoadLimit
impl UnwindSafe for LoadLimit
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