#[non_exhaustive]pub enum EndCause {
Released,
Expired,
Killed,
Removed,
}Expand description
Why a lease ended.
Kept apart from LeaseState, whose values are fixed by the database’s CHECK constraints
and by older allot-mcp builds that reject unknown states.
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.
Released
Its holder released it.
Expired
The daemon ended it because the heartbeat stopped or the holder died.
Killed
The user stopped the job and its process tree.
Removed
The user removed the request from the queue before it started.
Implementations§
Source§impl EndCause
impl EndCause
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The name used in storage and on the wire, for example killed.
Sourcepub fn ended_state(self) -> LeaseState
pub fn ended_state(self) -> LeaseState
The state a lease that ended this way is stored in. Kills and removals end in
Expired: the daemon ended the lease, not its holder, and older clients drop expired
leases the same way.
Trait Implementations§
impl Copy for EndCause
Source§impl<'de> Deserialize<'de> for EndCause
impl<'de> Deserialize<'de> for EndCause
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
impl Eq for EndCause
impl StructuralPartialEq for EndCause
Auto Trait Implementations§
impl Forget for EndCause
impl Freeze for EndCause
impl Move for EndCause
impl RefUnwindSafe for EndCause
impl Send for EndCause
impl Sync for EndCause
impl Unpin for EndCause
impl UnsafeUnpin for EndCause
impl UnwindSafe for EndCause
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