Skip to main content

ProofCarryingCode

Struct ProofCarryingCode 

Source
pub struct ProofCarryingCode { /* private fields */ }
Expand description

Proof-carrying code certificate

This combines code with proofs of its safety properties.

Implementations§

Source§

impl ProofCarryingCode

Source

pub fn new(code: impl Into<String>) -> Self

Create a new proof-carrying code certificate

Source

pub fn add_property(&mut self, property: SafetyProperty)

Add a safety property to be verified

Source

pub fn add_vc(&mut self, vc: VerificationCondition)

Add a verification condition

Source

pub fn attach_proof(&mut self, vc_id: &str, proof_node: ProofNodeId)

Attach a proof for a verification condition

Source

pub fn proof(&self) -> &Proof

Get the underlying proof structure

Source

pub fn proof_mut(&mut self) -> &mut Proof

Get a mutable reference to the proof

Source

pub fn code(&self) -> &str

Get the code

Source

pub fn properties(&self) -> &[SafetyProperty]

Get the certified properties

Source

pub fn verification_conditions(&self) -> &[VerificationCondition]

Get the verification conditions

Source

pub fn is_complete(&self) -> bool

Check if all VCs have proofs

Source

pub fn verified_count(&self) -> usize

Get the number of verified VCs

Source

pub fn total_vc_count(&self) -> usize

Get the total number of VCs

Source

pub fn to_certificate(&self) -> String

Generate a human-readable certificate

Trait Implementations§

Source§

impl Debug for ProofCarryingCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.