pub struct Claim { /* private fields */ }Expand description
A committed claim — write-once and immutable after it is appended to the store.
All fields are set at injection time via Claim::new; no field may be mutated after commit.
Fields are private to enforce the write-once invariant at compile time:
non-destruction (all writes are INSERT-only) and provenance immutability are both
upheld by the absence of setters.
Implementations§
Source§impl Claim
impl Claim
Sourcepub fn new(
claim_ref: ClaimRef,
agent_id: AgentId,
fact: Fact,
cardinality: Cardinality,
provenance: ProvenanceLabel,
external_anchor: ExternalAnchor,
transaction_time: TransactionTime,
valid_time: ValidTime,
confidence: Confidence,
criticality: Criticality,
derived_from: Vec<ClaimRef>,
metadata: Option<Value>,
snapshot_schema_version: Option<u32>,
) -> Self
pub fn new( claim_ref: ClaimRef, agent_id: AgentId, fact: Fact, cardinality: Cardinality, provenance: ProvenanceLabel, external_anchor: ExternalAnchor, transaction_time: TransactionTime, valid_time: ValidTime, confidence: Confidence, criticality: Criticality, derived_from: Vec<ClaimRef>, metadata: Option<Value>, snapshot_schema_version: Option<u32>, ) -> Self
Construct a fully-formed, frozen Claim. The only constructor.
Sourcepub fn cardinality(&self) -> &Cardinality
pub fn cardinality(&self) -> &Cardinality
Return the caller-supplied cardinality hint.
Sourcepub fn provenance(&self) -> &ProvenanceLabel
pub fn provenance(&self) -> &ProvenanceLabel
Return the provenance label.
Sourcepub fn external_anchor(&self) -> &ExternalAnchor
pub fn external_anchor(&self) -> &ExternalAnchor
Return the external anchor (source document, URL, etc.).
Sourcepub fn transaction_time(&self) -> &TransactionTime
pub fn transaction_time(&self) -> &TransactionTime
Return the transaction time (when the claim was written to the store).
Sourcepub fn valid_time(&self) -> &ValidTime
pub fn valid_time(&self) -> &ValidTime
Return the valid-time window (when the claim holds in the world).
Sourcepub fn confidence(&self) -> &Confidence
pub fn confidence(&self) -> &Confidence
Return the dual confidence scores.
Sourcepub fn criticality(&self) -> &Criticality
pub fn criticality(&self) -> &Criticality
Return the criticality class.
Sourcepub fn derived_from(&self) -> &[ClaimRef]
pub fn derived_from(&self) -> &[ClaimRef]
Return the list of upstream claims this claim was derived from.
Sourcepub fn snapshot_schema_version(&self) -> Option<u32>
pub fn snapshot_schema_version(&self) -> Option<u32>
Return the optional snapshot schema version for migration support.