#[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
Sourcepub fn set_first_index<T>(self, v: T) -> Self
pub fn set_first_index<T>(self, v: T) -> Self
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.
§Example
let x = PrecedenceRule::new().set_or_clear_first_index(Some(42));
let x = PrecedenceRule::new().set_or_clear_first_index(None::<i32>);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.
§Example
let x = PrecedenceRule::new().set_first_is_delivery(true);Sourcepub fn set_second_index<T>(self, v: T) -> Self
pub fn set_second_index<T>(self, v: T) -> Self
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.
§Example
let x = PrecedenceRule::new().set_or_clear_second_index(Some(42));
let x = PrecedenceRule::new().set_or_clear_second_index(None::<i32>);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.
§Example
let x = PrecedenceRule::new().set_second_is_delivery(true);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.
§Example
use wkt::Duration;
let x = PrecedenceRule::new().set_offset_duration(Duration::default()/* use setters */);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.
§Example
use wkt::Duration;
let x = PrecedenceRule::new().set_or_clear_offset_duration(Some(Duration::default()/* use setters */));
let x = PrecedenceRule::new().set_or_clear_offset_duration(None::<Duration>);Trait Implementations§
Source§impl Clone for PrecedenceRule
impl Clone for PrecedenceRule
Source§fn clone(&self) -> PrecedenceRule
fn clone(&self) -> PrecedenceRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrecedenceRule
impl Debug for PrecedenceRule
Source§impl Default for PrecedenceRule
impl Default for PrecedenceRule
Source§fn default() -> PrecedenceRule
fn default() -> PrecedenceRule
Source§impl Message for PrecedenceRule
impl Message for PrecedenceRule
Source§impl PartialEq for PrecedenceRule
impl PartialEq for PrecedenceRule
impl StructuralPartialEq for PrecedenceRule
Auto Trait Implementations§
impl Freeze for PrecedenceRule
impl RefUnwindSafe for PrecedenceRule
impl Send for PrecedenceRule
impl Sync for PrecedenceRule
impl Unpin for PrecedenceRule
impl UnsafeUnpin for PrecedenceRule
impl UnwindSafe for PrecedenceRule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request