pub enum Job {
Single(Arc<Single>),
Multi(Arc<Multi>),
}
Expand description
Represents a job variant.
Variants§
Implementations§
source§impl Job
impl Job
sourcepub fn dimens(&self) -> &Dimensions
pub fn dimens(&self) -> &Dimensions
Returns dimensions collection.
Examples found in repository?
More examples
examples/custom_constraint.rs (line 36)
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
fn evaluate(&self, move_ctx: &MoveContext<'_>) -> Option<ConstraintViolation> {
match move_ctx {
// matching job to route is evaluated before activity matching, so use it to improve search procedure
MoveContext::Route { route_ctx, job, .. } => {
let hardware_vehicle = route_ctx.route().actor.vehicle.dimens.get_vehicle_hardware();
let hardware_job = job.dimens().get_job_hardware();
match (hardware_job, hardware_vehicle) {
(None, _) => None,
(Some(hw_job), Some(hw_vehicle)) if hw_vehicle.contains(hw_job) => None,
_ => ConstraintViolation::fail(self.code),
}
}
// matching activity to route is called for every possible insertion point in the tour
// we don't need it here as hard constraint can be validated on route-job level
MoveContext::Activity { .. } => None,
}
}
Trait Implementations§
impl Eq for Job
Auto Trait Implementations§
impl Freeze for Job
impl !RefUnwindSafe for Job
impl Send for Job
impl Sync for Job
impl Unpin for Job
impl !UnwindSafe for Job
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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