tf-types 0.1.6

Core semantic types, traits, and schemas powering the TrustForge protocol.
Documentation
// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.

#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]

use serde::{Deserialize, Serialize};
use super::*;

/// JSON representation of a .tfproof bundle (TF-0005). Binary framing is defined in Phase 2.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProofBundle {
    /// Version of the proof-bundle schema itself.
    pub bundle_version: ProofBundle_BundleVersion,
    /// Proof events carried by this bundle, in their hash-chain order.
    pub events: Vec<ProofEvent>,
    /// Merkle root over the events, if computed.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub merkle_root: Option<HashRef>,
    /// Hash over the event sequence as a linear hash-chain.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub chain_hash: Option<HashRef>,
    /// Anchoring metadata if this bundle was submitted to a transparency log.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub transparency_anchor: Option<ProofBundle_TransparencyAnchor>,
    /// Signature envelope over the canonical form of this bundle (not verified in the foundation phase).
    pub signature: SignatureEnvelope,
}

/// Version of the proof-bundle schema itself.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProofBundle_BundleVersion {
    #[serde(rename = "1")]
    V1,
}

/// Anchoring metadata if this bundle was submitted to a transparency log.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProofBundle_TransparencyAnchor {
    /// Anchor backend kind.
    pub kind: String,
    /// Endpoint of the anchor backend.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub url: Option<String>,
    /// Opaque inclusion-proof blob returned by the backend.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub inclusion_proof: Option<serde_json::Value>,
}