#[non_exhaustive]pub enum LeaseState {
Claimed,
Started,
Ended,
Revoked,
Expired,
}Expand description
A lease’s state. Only claimed and started are current.
§Examples
use stratum_node_core::LeaseState;
assert!(LeaseState::Claimed.is_current());
assert!(!LeaseState::Ended.is_current());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.
Claimed
Claimed; the container may not have started.
Started
The container runs with its limits verified and the signing window open.
Ended
Ended by a result, or by the container exiting without one.
Revoked
Revoked by withdrawal, suspension, application disable or removal.
Expired
Its deadline passed, or a restore expired it.
Implementations§
Source§impl LeaseState
impl LeaseState
Source§impl LeaseState
impl LeaseState
Sourcepub fn is_current(self) -> bool
pub fn is_current(self) -> bool
Returns true for claimed and started.
Trait Implementations§
Source§impl Clone for LeaseState
impl Clone for LeaseState
impl Copy for LeaseState
Source§impl Debug for LeaseState
impl Debug for LeaseState
Source§impl<'de> Deserialize<'de> for LeaseState
impl<'de> Deserialize<'de> for LeaseState
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LeaseState
impl Display for LeaseState
impl Eq for LeaseState
Source§impl FromStr for LeaseState
impl FromStr for LeaseState
Source§impl Hash for LeaseState
impl Hash for LeaseState
Source§impl Ord for LeaseState
impl Ord for LeaseState
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for LeaseState
impl PartialEq for LeaseState
Source§impl PartialOrd for LeaseState
impl PartialOrd for LeaseState
Source§impl Serialize for LeaseState
impl Serialize for LeaseState
impl StructuralPartialEq for LeaseState
Auto Trait Implementations§
impl Forget for LeaseState
impl Freeze for LeaseState
impl Move for LeaseState
impl RefUnwindSafe for LeaseState
impl Send for LeaseState
impl Sync for LeaseState
impl Unpin for LeaseState
impl UnsafeUnpin for LeaseState
impl UnwindSafe for LeaseState
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