pub struct ContextContribution {Show 15 fields
pub contribution_id: ContextContributionId,
pub kind: ContextContributionKind,
pub producer_ref: EntityRef,
pub source_ref: SourceRef,
pub content_ref: Option<ContentRef>,
pub inline_redacted_summary: Option<String>,
pub derived_from: Vec<EntityRef>,
pub policy_refs: Vec<PolicyRef>,
pub privacy_class: PrivacyClass,
pub retention_class: RetentionClass,
pub trust_class: TrustClass,
pub budget_hint: Option<ContextBudgetHint>,
pub required: bool,
pub protected: bool,
pub redacted_summary: String,
}Expand description
Carries the context contribution record payload for journal, event, or fixture surfaces. Creating or cloning it only preserves serialized SDK state; append, publish, replay, or export effects are documented on the runtime and port methods that store it.
Fields§
§contribution_id: ContextContributionIdStable contribution id used for typed lineage, lookup, or dedupe.
kind: ContextContributionKindKind/category for this record, capability, event, or detected resource.
producer_ref: EntityRefTyped producer ref reference. Resolving or executing it is a separate policy-gated step.
source_ref: SourceRefTyped source reference that records where this item originated.
content_ref: Option<ContentRef>Content reference where payload bytes or structured tool output are stored.
inline_redacted_summary: Option<String>Redacted summary for display, logs, events, or telemetry. It should describe the value without exposing raw private content.
derived_from: Vec<EntityRef>Source refs this value was derived from. Use them to trace provenance without embedding raw source content.
policy_refs: Vec<PolicyRef>Policy references that govern admission, projection, execution, or delivery.
privacy_class: PrivacyClassPrivacy class used for projection, telemetry, and raw-content access decisions.
retention_class: RetentionClassRetention class used by hosts and sinks when storing or exporting this item.
trust_class: TrustClassTrust class used when deciding whether context or capabilities may be admitted.
budget_hint: Option<ContextBudgetHint>Optional budget hint value. When absent, callers should use the documented default or skip that optional behavior.
required: boolWhether required is enabled. Policy, validation, or routing code uses this flag to choose the explicit behavior.
protected: boolWhether protected is enabled. Policy, validation, or routing code uses this flag to choose the explicit behavior.
redacted_summary: StringRedacted human-readable summary safe for events, telemetry, and logs.
Implementations§
Source§impl ContextContribution
impl ContextContribution
Sourcepub fn new(
contribution_id: ContextContributionId,
kind: ContextContributionKind,
producer_ref: EntityRef,
source_ref: SourceRef,
policy_ref: PolicyRef,
redacted_summary: impl Into<String>,
) -> Self
pub fn new( contribution_id: ContextContributionId, kind: ContextContributionKind, producer_ref: EntityRef, source_ref: SourceRef, policy_ref: PolicyRef, redacted_summary: impl Into<String>, ) -> Self
Creates a new records::context value with explicit caller-provided inputs. This constructor is data-only and performs no I/O or external side effects.
Sourcepub fn with_content_ref(self, content_ref: ContentRef) -> Self
pub fn with_content_ref(self, content_ref: ContentRef) -> Self
Returns this value with its content ref setting replaced. The method follows builder-style data construction and does not execute external work.
Trait Implementations§
Source§impl Clone for ContextContribution
impl Clone for ContextContribution
Source§fn clone(&self) -> ContextContribution
fn clone(&self) -> ContextContribution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContextContribution
impl Debug for ContextContribution
Source§impl<'de> Deserialize<'de> for ContextContribution
impl<'de> Deserialize<'de> for ContextContribution
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ContextContribution
Source§impl PartialEq for ContextContribution
impl PartialEq for ContextContribution
Source§fn eq(&self, other: &ContextContribution) -> bool
fn eq(&self, other: &ContextContribution) -> bool
self and other values to be equal, and is used by ==.