Skip to main content

append_attestation

Function append_attestation 

Source
pub fn append_attestation(
    root: &Path,
    asset: &Uuid,
    capture_utc: Option<i64>,
    cbor: &[u8],
) -> Result<bool, AttestationStoreError>
Expand description

Append a verified attestation (cbor, its bytes as received) to the log of asset.

Refused with AttestationStoreError::NotAboutAsset when the attestation carries no verdict for asset. Idempotent on the nonce: returns Ok(false) without writing when an attestation with the same nonce is already in the log, and Ok(true) when it appended. The log is rewritten through a temporary sibling and a rename, so a crash mid-write leaves the previous log whole.