#[non_exhaustive]pub struct ConstraintRelaxation {
pub relaxations: Vec<Relaxation>,
pub vehicle_indices: Vec<i32>,
/* private fields */
}Expand description
For a group of vehicles, specifies at what threshold(s) constraints on
visits will be relaxed and to which level. Shipments listed in
the skipped_shipment field are constrained to be skipped; i.e., they
cannot be performed.
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.relaxations: Vec<Relaxation>All the visit constraint relaxations that will apply to visits on
routes with vehicles in vehicle_indices.
vehicle_indices: Vec<i32>Specifies the vehicle indices to which the visit constraint
relaxations apply. If empty, this is considered the default and the
relaxations apply to all vehicles that are not specified in other
constraint_relaxations. There can be at most one default, i.e., at
most one constraint relaxation field is allowed empty
vehicle_indices. A vehicle index can only be listed once, even within
several constraint_relaxations.
A vehicle index is mapped the same as
ShipmentRoute.vehicle_index,
if interpret_injected_solutions_using_labels is true (see fields
comment).
Implementations§
Source§impl ConstraintRelaxation
impl ConstraintRelaxation
Sourcepub fn set_relaxations<T, V>(self, v: T) -> Self
pub fn set_relaxations<T, V>(self, v: T) -> Self
Sets the value of relaxations.
§Example
use google_cloud_optimization_v1::model::injected_solution_constraint::constraint_relaxation::Relaxation;
let x = ConstraintRelaxation::new()
.set_relaxations([
Relaxation::default()/* use setters */,
Relaxation::default()/* use (different) setters */,
]);Sourcepub fn set_vehicle_indices<T, V>(self, v: T) -> Self
pub fn set_vehicle_indices<T, V>(self, v: T) -> Self
Sets the value of vehicle_indices.
§Example
let x = ConstraintRelaxation::new().set_vehicle_indices([1, 2, 3]);Trait Implementations§
Source§impl Clone for ConstraintRelaxation
impl Clone for ConstraintRelaxation
Source§fn clone(&self) -> ConstraintRelaxation
fn clone(&self) -> ConstraintRelaxation
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 ConstraintRelaxation
impl Debug for ConstraintRelaxation
Source§impl Default for ConstraintRelaxation
impl Default for ConstraintRelaxation
Source§fn default() -> ConstraintRelaxation
fn default() -> ConstraintRelaxation
Source§impl Message for ConstraintRelaxation
impl Message for ConstraintRelaxation
Source§impl PartialEq for ConstraintRelaxation
impl PartialEq for ConstraintRelaxation
impl StructuralPartialEq for ConstraintRelaxation
Auto Trait Implementations§
impl Freeze for ConstraintRelaxation
impl RefUnwindSafe for ConstraintRelaxation
impl Send for ConstraintRelaxation
impl Sync for ConstraintRelaxation
impl Unpin for ConstraintRelaxation
impl UnsafeUnpin for ConstraintRelaxation
impl UnwindSafe for ConstraintRelaxation
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