#[non_exhaustive]pub enum AdmissionPolicy {
DropIfRunning,
Replace,
Queue,
}Expand description
Defines how the controller admits a new task into a slot.
A slot may only run one task at a time. When a new task arrives, the controller applies the selected policy to determine what to do if the slot is already occupied.
| Variant | Behaviour |
|---|---|
DropIfRunning | Ignore the new task, return success without scheduling |
Replace | Cancel the running task, schedule the new one |
Queue | Enqueue the new task, run when slot becomes free |
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DropIfRunning
If the slot already has a running task, ignore the new one.
Replace
Cancel the currently running task in the slot and replace it with the newly submitted task.
Queue
Enqueue the new task to be executed after the current one completes.
Trait Implementations§
Source§impl Clone for AdmissionPolicy
impl Clone for AdmissionPolicy
Source§fn clone(&self) -> AdmissionPolicy
fn clone(&self) -> AdmissionPolicy
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 AdmissionPolicy
impl Debug for AdmissionPolicy
Source§impl Default for AdmissionPolicy
impl Default for AdmissionPolicy
Source§fn default() -> AdmissionPolicy
fn default() -> AdmissionPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AdmissionPolicy
impl<'de> Deserialize<'de> for AdmissionPolicy
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
Source§impl FromStr for AdmissionPolicy
impl FromStr for AdmissionPolicy
Source§type Err = ModelError
type Err = ModelError
The associated error which can be returned from parsing.
Source§impl PartialEq for AdmissionPolicy
impl PartialEq for AdmissionPolicy
Source§impl Serialize for AdmissionPolicy
impl Serialize for AdmissionPolicy
impl Copy for AdmissionPolicy
impl Eq for AdmissionPolicy
impl StructuralPartialEq for AdmissionPolicy
Auto Trait Implementations§
impl Freeze for AdmissionPolicy
impl RefUnwindSafe for AdmissionPolicy
impl Send for AdmissionPolicy
impl Sync for AdmissionPolicy
impl Unpin for AdmissionPolicy
impl UnsafeUnpin for AdmissionPolicy
impl UnwindSafe for AdmissionPolicy
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