idiolect-records 0.2.0

Rust record types mirroring the dev.idiolect.* Lexicon family.
Documentation
// @generated by idiolect-codegen. do not edit.
// source: dev.idiolect.belief

//! A signed doxastic claim that a referenced record is true or applicable. Belief records are how third parties represent what *they* think about *another* record without flattening provenance — the `subject` strong-ref pins the exact referenced record, the `holder` names the party whose attitude is represented, and the `basis` names what grounds it.

#![allow(
    missing_docs,
    clippy::doc_markdown,
    clippy::struct_excessive_bools,
    clippy::derive_partial_eq_without_eq
)]
use serde::{Deserialize, Serialize};

/// A doxastic attitude about another record. Common use: a labeler publishes a permission / encounter / attribution record in its own repo and then a belief record pointing to it, naming the DID whose attitude the labeler is attributing and on what basis. A consumer resolving the belief sees both the referenced record (via `subject`) and the provenance that produced it (via `holder` + `basis`).
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Belief {
    /// Narrative commentary on the belief. Not consumed by machine matchers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<String>,
    /// Grounding for the belief: selfAsserted, communityPolicy, externalSignal, or derivedFromRecord. Especially load-bearing when `holder` differs from the repo owner, since consumers need to know what warrant the record has.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub basis: Option<super::defs::Basis>,
    /// DID of the party whose attitude is being represented. Omit when the repo owner holds the belief themselves; set explicitly when a third party (a labeler, a reviewer, a researcher) is attributing a belief to someone else.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub holder: Option<String>,
    pub occurred_at: String,
    /// Strong reference (AT-URI + CID) to the record the belief is about. Pinning via CID means a later revision of that record does not silently change what this belief asserts.
    pub subject: super::defs::StrongRecordRef,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub visibility: Option<super::defs::Visibility>,
}

impl crate::Record for Belief {
    const NSID: &'static str = "dev.idiolect.belief";
}