#[non_exhaustive]pub struct PrecedenceRule {
pub first_index: Option<i32>,
pub first_is_delivery: bool,
pub second_index: Option<i32>,
pub second_is_delivery: bool,
pub offset_duration: Option<Duration>,
/* private fields */
}Expand description
A precedence rule between two events (each event is the pickup or the
delivery of a shipment): the “second” event has to start at least
offset_duration after “first” has started.
Several precedences can refer to the same (or related) events, e.g., “pickup of B happens after delivery of A” and “pickup of C happens after pickup of B”.
Furthermore, precedences only apply when both shipments are performed and are otherwise ignored.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.first_index: Option<i32>Shipment index of the “first” event. This field must be specified.
first_is_delivery: boolIndicates if the “first” event is a delivery.
second_index: Option<i32>Shipment index of the “second” event. This field must be specified.
second_is_delivery: boolIndicates if the “second” event is a delivery.
offset_duration: Option<Duration>The offset between the “first” and “second” event. It can be negative.
Implementations§
Source§impl PrecedenceRule
impl PrecedenceRule
pub fn new() -> Self
Sourcepub fn set_first_index<T>(self, v: T) -> Self
pub fn set_first_index<T>(self, v: T) -> Self
Sets the value of first_index.
Sourcepub fn set_or_clear_first_index<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_first_index<T>(self, v: Option<T>) -> Self
Sets or clears the value of first_index.
Sourcepub fn set_first_is_delivery<T: Into<bool>>(self, v: T) -> Self
pub fn set_first_is_delivery<T: Into<bool>>(self, v: T) -> Self
Sets the value of first_is_delivery.
Sourcepub fn set_second_index<T>(self, v: T) -> Self
pub fn set_second_index<T>(self, v: T) -> Self
Sets the value of second_index.
Sourcepub fn set_or_clear_second_index<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_second_index<T>(self, v: Option<T>) -> Self
Sets or clears the value of second_index.
Sourcepub fn set_second_is_delivery<T: Into<bool>>(self, v: T) -> Self
pub fn set_second_is_delivery<T: Into<bool>>(self, v: T) -> Self
Sets the value of second_is_delivery.
Sourcepub fn set_offset_duration<T>(self, v: T) -> Self
pub fn set_offset_duration<T>(self, v: T) -> Self
Sets the value of offset_duration.
Sourcepub fn set_or_clear_offset_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_offset_duration<T>(self, v: Option<T>) -> Self
Sets or clears the value of offset_duration.
Trait Implementations§
Source§impl Clone for PrecedenceRule
impl Clone for PrecedenceRule
Source§fn clone(&self) -> PrecedenceRule
fn clone(&self) -> PrecedenceRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more