pub struct ExternalContext {
pub dataset_id: Option<String>,
pub lineage: ExternalLineage,
pub origin: ExternalOrigin,
pub source: String,
}Expand description
A typed, externally-supplied context record, stored beside the field.
Every field is optional except the origin and the (advisory) source label, so a caller can attach only the facts it actually holds rather than inventing the rest.
Fields§
§dataset_id: Option<String>The dataset the document belongs to (e.g. real100-v1).
lineage: ExternalLineageThe external lineage tuple.
origin: ExternalOriginWhere the facts came from.
source: StringA human-readable provenance label (e.g. the manifest path or row).
Implementations§
Source§impl ExternalContext
impl ExternalContext
Sourcepub fn encode_canonical(&self) -> Vec<u8> ⓘ
pub fn encode_canonical(&self) -> Vec<u8> ⓘ
Canonical, self-describing encoding.
Sourcepub fn decode_canonical(bytes: &[u8]) -> Result<ExternalContext>
pub fn decode_canonical(bytes: &[u8]) -> Result<ExternalContext>
Parse a canonical external-context record, failing closed on any malformation rather than answering from a partially-understood record.
Sourcepub fn answer_json(&self) -> String
pub fn answer_json(&self) -> String
The typed answer body. The lineage tuple is named exactly as the C4b
contract names it (family_id / member_id / is_head), so an answer
can be compared to the baseline’s tuple without a projection.