pub struct ResidualCertificate {
pub certificate_id: String,
pub node_id: String,
pub generation: u32,
pub ledger_head: String,
pub final_energy: f64,
pub final_residuals: Vec<ResidualEvent>,
pub exhausted_budgets: Vec<BudgetRef>,
pub verifier_routes: Vec<IndependenceRoute>,
pub rejected_attempts: Vec<String>,
pub next_correction_directions: Vec<CorrectionDirection>,
}Expand description
A residual certificate (PSP-8 ResidualCertificate).
Fields§
§certificate_id: String§node_id: String§generation: u32§ledger_head: StringLedger head at the moment the certificate was issued.
final_energy: f64Final total energy V.
final_residuals: Vec<ResidualEvent>Final residual vector.
exhausted_budgets: Vec<BudgetRef>Budgets that were exhausted.
verifier_routes: Vec<IndependenceRoute>Verifier independence routes exercised.
rejected_attempts: Vec<String>Identifiers of rejected (observed-only) attempts.
next_correction_directions: Vec<CorrectionDirection>Correction directions that remain to be tried.
Implementations§
Source§impl ResidualCertificate
impl ResidualCertificate
Sourcepub fn from_residuals(
node_id: impl Into<String>,
generation: u32,
ledger_head: impl Into<String>,
final_energy: f64,
final_residuals: Vec<ResidualEvent>,
) -> Self
pub fn from_residuals( node_id: impl Into<String>, generation: u32, ledger_head: impl Into<String>, final_energy: f64, final_residuals: Vec<ResidualEvent>, ) -> Self
Build a certificate from the final residual vector, deriving the verifier routes and outstanding correction directions from the residuals.
pub fn with_exhausted_budget(self, budget: BudgetRef) -> Self
pub fn with_rejected_attempts(self, attempts: Vec<String>) -> Self
Trait Implementations§
Source§impl Clone for ResidualCertificate
impl Clone for ResidualCertificate
Source§fn clone(&self) -> ResidualCertificate
fn clone(&self) -> ResidualCertificate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ResidualCertificate
impl Debug for ResidualCertificate
Source§impl<'de> Deserialize<'de> for ResidualCertificate
impl<'de> Deserialize<'de> for ResidualCertificate
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 PartialEq for ResidualCertificate
impl PartialEq for ResidualCertificate
Source§fn eq(&self, other: &ResidualCertificate) -> bool
fn eq(&self, other: &ResidualCertificate) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ResidualCertificate
impl Serialize for ResidualCertificate
impl StructuralPartialEq for ResidualCertificate
Auto Trait Implementations§
impl Freeze for ResidualCertificate
impl RefUnwindSafe for ResidualCertificate
impl Send for ResidualCertificate
impl Sync for ResidualCertificate
impl Unpin for ResidualCertificate
impl UnsafeUnpin for ResidualCertificate
impl UnwindSafe for ResidualCertificate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.