#[non_exhaustive]pub enum Enforcement {
Enforcing,
Enforced,
}Expand description
Whether the gate is known to enforce one suspension.
Enforcement belongs to one suspension, named by key, generation and
suspension number. It is enforcing until the gate is known to hold a
directory revision that lists the suspension, or until the gate’s lease
must have run out; then it is enforced. It is never stored.
The text form is "enforcing" or "enforced".
§Examples
use stratum_node_core::Enforcement;
assert_eq!(serde_json::to_string(&Enforcement::Enforced)?, "\"enforced\"");
assert_eq!(serde_json::from_str::<Enforcement>("\"enforcing\"")?, Enforcement::Enforcing);
assert_eq!(Enforcement::Enforcing.to_string(), "enforcing");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.
Enforcing
The suspension is committed, and the gate is not yet known to apply it.
Enforced
The gate admits no new signed request by or to the member. Requests admitted earlier may still be running.
Implementations§
Trait Implementations§
Source§impl Clone for Enforcement
impl Clone for Enforcement
impl Copy for Enforcement
Source§impl Debug for Enforcement
impl Debug for Enforcement
Source§impl<'de> Deserialize<'de> for Enforcement
impl<'de> Deserialize<'de> for Enforcement
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 Display for Enforcement
impl Display for Enforcement
impl Eq for Enforcement
Source§impl Hash for Enforcement
impl Hash for Enforcement
Source§impl Ord for Enforcement
impl Ord for Enforcement
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 Enforcement
impl PartialEq for Enforcement
Source§impl PartialOrd for Enforcement
impl PartialOrd for Enforcement
Source§impl Serialize for Enforcement
impl Serialize for Enforcement
impl StructuralPartialEq for Enforcement
Auto Trait Implementations§
impl Forget for Enforcement
impl Freeze for Enforcement
impl Move for Enforcement
impl RefUnwindSafe for Enforcement
impl Send for Enforcement
impl Sync for Enforcement
impl Unpin for Enforcement
impl UnsafeUnpin for Enforcement
impl UnwindSafe for Enforcement
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