pub struct Attestation {
pub attestation_id: AttestationId,
pub stage_id: StageId,
pub op_id: Option<OpId>,
pub intent_id: Option<IntentId>,
pub kind: AttestationKind,
pub result: AttestationResult,
pub produced_by: ProducerDescriptor,
pub cost: Option<Cost>,
pub timestamp: u64,
pub signature: Option<Signature>,
}Expand description
The persisted attestation. See module docs for what each field is, what’s in the hash, and what isn’t.
Fields§
§attestation_id: AttestationId§stage_id: StageId§op_id: Option<OpId>§intent_id: Option<IntentId>§kind: AttestationKind§result: AttestationResult§produced_by: ProducerDescriptor§cost: Option<Cost>§timestamp: u64Wall-clock seconds since epoch when this attestation was
produced. Excluded from attestation_id so the dedup
property holds across runs.
signature: Option<Signature>Implementations§
Source§impl Attestation
impl Attestation
Sourcepub fn new(
stage_id: impl Into<StageId>,
op_id: Option<OpId>,
intent_id: Option<IntentId>,
kind: AttestationKind,
result: AttestationResult,
produced_by: ProducerDescriptor,
cost: Option<Cost>,
) -> Self
pub fn new( stage_id: impl Into<StageId>, op_id: Option<OpId>, intent_id: Option<IntentId>, kind: AttestationKind, result: AttestationResult, produced_by: ProducerDescriptor, cost: Option<Cost>, ) -> Self
Build an attestation against a stage, computing its
content-addressed id. timestamp defaults to the current
wall clock; pass to Attestation::with_timestamp in tests.
Sourcepub fn with_timestamp(
stage_id: impl Into<StageId>,
op_id: Option<OpId>,
intent_id: Option<IntentId>,
kind: AttestationKind,
result: AttestationResult,
produced_by: ProducerDescriptor,
cost: Option<Cost>,
timestamp: u64,
) -> Self
pub fn with_timestamp( stage_id: impl Into<StageId>, op_id: Option<OpId>, intent_id: Option<IntentId>, kind: AttestationKind, result: AttestationResult, produced_by: ProducerDescriptor, cost: Option<Cost>, timestamp: u64, ) -> Self
Build an attestation with a caller-controlled timestamp.
Used in tests to keep golden hashes stable.
Sourcepub fn with_signature(self, signature: Signature) -> Self
pub fn with_signature(self, signature: Signature) -> Self
Attach a signature. The signature is not part of the hash;
the same logical attestation produced by an unsigned harness
dedupes against a signed one. Callers who want signature
to be part of identity should hash signature into the
produced_by.tool string explicitly.
Trait Implementations§
Source§impl Clone for Attestation
impl Clone for Attestation
Source§fn clone(&self) -> Attestation
fn clone(&self) -> Attestation
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 Attestation
impl Debug for Attestation
Source§impl<'de> Deserialize<'de> for Attestation
impl<'de> Deserialize<'de> for Attestation
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 PartialEq for Attestation
impl PartialEq for Attestation
Source§fn eq(&self, other: &Attestation) -> bool
fn eq(&self, other: &Attestation) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Attestation
impl Serialize for Attestation
impl Eq for Attestation
impl StructuralPartialEq for Attestation
Auto Trait Implementations§
impl Freeze for Attestation
impl RefUnwindSafe for Attestation
impl Send for Attestation
impl Sync for Attestation
impl Unpin for Attestation
impl UnsafeUnpin for Attestation
impl UnwindSafe for Attestation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.