Skip to main content

AttestedComputation

Struct AttestedComputation 

Source
pub struct AttestedComputation {
    pub runtime: Option<String>,
    pub parameters: Vec<Parameter>,
    pub computation: ComputationSource,
    pub executor: Option<Executor>,
    pub attester: Option<Attester>,
    pub has_redundant_inline: bool,
}
Expand description

The contract of an Attested Computation concept: its top-level frontmatter plus the computation itself.

Fields§

§runtime: Option<String>

REQUIRED for this type: how to run the computation, and so how the executor and attester interpret it and what parameters mean.

§parameters: Vec<Parameter>

The typed, named holes an agent may fill.

§computation: ComputationSource

The sanctioned computation, inline or by path.

§executor: Option<Executor>

How the computation is run.

§attester: Option<Attester>

The deterministic check over a run’s receipt.

§has_redundant_inline: bool

true when the body carries a # Computation block and the computation key names a file. The spec asks for one or the other, so this flags a contract whose two halves may disagree.

Implementations§

Source§

impl AttestedComputation

Source

pub fn from_parts(frontmatter: &Frontmatter, body: &str) -> Self

Reads the contract from a concept’s frontmatter and body.

This does not check that the concept’s type is ATTESTED_COMPUTATION_TYPE, since the computation keys are ordinary frontmatter and a producer may use them on another type. Use Frontmatter::is_attested_computation to test the type.

Source

pub fn required_parameters(&self) -> impl Iterator<Item = &Parameter>

The parameters an agent must supply a value for.

Source

pub fn path_fields(&self) -> Vec<(&'static str, &str)>

The path-valued fields of this contract, as (field name, raw path) pairs, the inputs to links::field_path_candidates when checking that a contract points at something real.

Trait Implementations§

Source§

impl Clone for AttestedComputation

Source§

fn clone(&self) -> AttestedComputation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AttestedComputation

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for AttestedComputation

Source§

impl PartialEq for AttestedComputation

Source§

fn eq(&self, other: &AttestedComputation) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AttestedComputation

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.