pub struct EnforcementParts {
pub authorisation: Enforcement,
pub keys: KeysPart,
pub work: WorkPart,
}Expand description
The parts of one enforcement (a suspension, a withdrawal or an application disable): the authorisation at the gate and the proxy, the keys at the signer and the work at the runner. None of it is stored; it is recomputed for each answer.
§Examples
use stratum_node_core::{Enforcement, EnforcementParts, KeysPart, WorkPart};
let parts = EnforcementParts {
authorisation: Enforcement::Enforced,
keys: KeysPart::Disabling,
work: WorkPart::Stopped,
};
assert_eq!(
serde_json::to_string(&parts)?,
r#"{"authorisation":"enforced","keys":"disabling","work":"stopped"}"#,
);
assert!(!parts.is_complete());Fields§
The gate and the proxy: enforced once both apply the revision, or
their 310 s fallback has run out.
keys: KeysPartThe signer.
work: WorkPartThe runner.
Implementations§
Source§impl EnforcementParts
impl EnforcementParts
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true when every part is done: enforced, disabled,
stopped.
Trait Implementations§
Source§impl Clone for EnforcementParts
impl Clone for EnforcementParts
impl Copy for EnforcementParts
Source§impl Debug for EnforcementParts
impl Debug for EnforcementParts
Source§impl<'de> Deserialize<'de> for EnforcementParts
impl<'de> Deserialize<'de> for EnforcementParts
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 EnforcementParts
Source§impl Hash for EnforcementParts
impl Hash for EnforcementParts
Source§impl PartialEq for EnforcementParts
impl PartialEq for EnforcementParts
Source§impl Serialize for EnforcementParts
impl Serialize for EnforcementParts
impl StructuralPartialEq for EnforcementParts
Auto Trait Implementations§
impl Forget for EnforcementParts
impl Freeze for EnforcementParts
impl Move for EnforcementParts
impl RefUnwindSafe for EnforcementParts
impl Send for EnforcementParts
impl Sync for EnforcementParts
impl Unpin for EnforcementParts
impl UnsafeUnpin for EnforcementParts
impl UnwindSafe for EnforcementParts
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