pub struct ProofClosureReport { /* private fields */ }Expand description
Closure report for a proof graph.
The state field is private by design. Callers either create a full report
with ProofClosureReport::full_chain_verified or let
ProofClosureReport::from_edges compute the weakest truthful state from
the supplied failures.
Implementations§
Source§impl ProofClosureReport
impl ProofClosureReport
Sourcepub fn full_chain_verified(verified_edges: Vec<ProofEdge>) -> Self
pub fn full_chain_verified(verified_edges: Vec<ProofEdge>) -> Self
Construct a report that has no failing edges.
Sourcepub fn from_edges(
verified_edges: Vec<ProofEdge>,
failing_edges: Vec<FailingEdge>,
) -> Self
pub fn from_edges( verified_edges: Vec<ProofEdge>, failing_edges: Vec<FailingEdge>, ) -> Self
Construct a report and compute state from the supplied failing edges.
Any broken failure makes the report ProofState::Broken. Any
non-empty missing or unresolved failure list makes it
ProofState::Partial. Only an empty failure list can be full.
Sourcepub const fn state(&self) -> ProofState
pub const fn state(&self) -> ProofState
Current proof state.
Sourcepub fn verified_edges(&self) -> &[ProofEdge]
pub fn verified_edges(&self) -> &[ProofEdge]
Verified edges.
Sourcepub fn failing_edges(&self) -> &[FailingEdge]
pub fn failing_edges(&self) -> &[FailingEdge]
Missing, unresolved, or invalid edges.
Sourcepub const fn is_full_chain_verified(&self) -> bool
pub const fn is_full_chain_verified(&self) -> bool
Whether the report is fully verified.
Sourcepub fn push_failing_edge(&mut self, edge: FailingEdge)
pub fn push_failing_edge(&mut self, edge: FailingEdge)
Add a failing edge and recompute the weakest truthful state.
Sourcepub fn with_failing_edge(self, edge: FailingEdge) -> Self
pub fn with_failing_edge(self, edge: FailingEdge) -> Self
Add a failing edge and return the updated report.
Sourcepub fn policy_decision(&self) -> PolicyDecision
pub fn policy_decision(&self) -> PolicyDecision
Derive the ADR 0026 policy decision for this proof closure.
Sourcepub fn require_current_use_allowed(&self) -> CoreResult<()>
pub fn require_current_use_allowed(&self) -> CoreResult<()>
Fail closed before this proof report is consumed as current authority.
Trait Implementations§
Source§impl Clone for ProofClosureReport
impl Clone for ProofClosureReport
Source§fn clone(&self) -> ProofClosureReport
fn clone(&self) -> ProofClosureReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProofClosureReport
impl Debug for ProofClosureReport
Source§impl<'de> Deserialize<'de> for ProofClosureReport
impl<'de> Deserialize<'de> for ProofClosureReport
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>,
Source§impl JsonSchema for ProofClosureReport
impl JsonSchema for ProofClosureReport
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for ProofClosureReport
impl PartialEq for ProofClosureReport
Source§fn eq(&self, other: &ProofClosureReport) -> bool
fn eq(&self, other: &ProofClosureReport) -> bool
self and other values to be equal, and is used by ==.