pub enum ConstraintType {
Capacity {
resource: String,
limit: f64,
},
TimeWindow {
start: i64,
end: i64,
},
Precedence {
before: String,
after: String,
},
Exclusion {
items: Vec<String>,
},
Minimum {
resource: String,
value: f64,
},
Maximum {
resource: String,
value: f64,
},
Custom {
key: String,
value: Value,
},
}Expand description
Constraint type (pack-specific interpretation)
Variants§
Capacity
Capacity constraint
TimeWindow
Time window constraint
Precedence
Precedence constraint
Exclusion
Exclusion constraint (mutual exclusivity)
Minimum
Minimum requirement
Maximum
Maximum limit
Custom
Custom constraint (pack interprets)
Implementations§
Source§impl ConstraintType
impl ConstraintType
Sourcepub fn time_window(start: i64, end: i64) -> Self
pub fn time_window(start: i64, end: i64) -> Self
Create a time window constraint
Trait Implementations§
Source§impl Clone for ConstraintType
impl Clone for ConstraintType
Source§fn clone(&self) -> ConstraintType
fn clone(&self) -> ConstraintType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstraintType
impl Debug for ConstraintType
Source§impl<'de> Deserialize<'de> for ConstraintType
impl<'de> Deserialize<'de> for ConstraintType
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
Auto Trait Implementations§
impl Freeze for ConstraintType
impl RefUnwindSafe for ConstraintType
impl Send for ConstraintType
impl Sync for ConstraintType
impl Unpin for ConstraintType
impl UnsafeUnpin for ConstraintType
impl UnwindSafe for ConstraintType
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