pub struct CapacityRequestPolicy {
pub default: Option<Quantity>,
pub valid_range: Option<CapacityRequestPolicyRange>,
pub valid_values: Option<Vec<Quantity>>,
}
Expand description
CapacityRequestPolicy defines how requests consume device capacity.
Must not set more than one ValidRequestValues.
Fields§
§default: Option<Quantity>
Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest’s Capacity.
valid_range: Option<CapacityRequestPolicyRange>
ValidRange defines an acceptable quantity value range in consuming requests.
If this field is set, Default must be defined and it must fall within the defined ValidRange.
If the requested amount does not fall within the defined range, the request violates the policy, and this device cannot be allocated.
If the request doesn’t contain this capacity entry, Default value is used.
valid_values: Option<Vec<Quantity>>
ValidValues defines a set of acceptable quantity values in consuming requests.
Must not contain more than 10 entries. Must be sorted in ascending order.
If this field is set, Default must be defined and it must be included in ValidValues list.
If the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues).
If the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated.
Trait Implementations§
Source§impl Clone for CapacityRequestPolicy
impl Clone for CapacityRequestPolicy
Source§fn clone(&self) -> CapacityRequestPolicy
fn clone(&self) -> CapacityRequestPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CapacityRequestPolicy
impl Debug for CapacityRequestPolicy
Source§impl DeepMerge for CapacityRequestPolicy
impl DeepMerge for CapacityRequestPolicy
Source§fn merge_from(&mut self, other: Self)
fn merge_from(&mut self, other: Self)
other
into self
.