pub struct ContextExport {
pub schema_version: String,
pub policy_version: String,
pub session_id: String,
pub accounting: Option<ProviderRequestAccounting>,
pub budget: ExportBudget,
pub items: Vec<ExportContextItem>,
pub model_projection: Vec<ExportProjectionMessage>,
pub receipts: Vec<ContextReductionReceipt>,
pub diagnostics: Vec<String>,
pub artifacts: Vec<ExportArtifact>,
}Expand description
Versioned export of one selected request and its context ledger.
Fields§
§schema_version: StringExport schema version.
policy_version: StringRedaction and bounding policy version.
session_id: StringSession identity.
accounting: Option<ProviderRequestAccounting>Selected request accounting, when a provider request has completed.
budget: ExportBudgetContext budget at inspection time.
items: Vec<ExportContextItem>Ordered context candidate metadata.
model_projection: Vec<ExportProjectionMessage>Bounded model-facing projection for the selected request.
receipts: Vec<ContextReductionReceipt>Shadow/applied reduction receipts.
diagnostics: Vec<String>Export-safe diagnostics.
artifacts: Vec<ExportArtifact>Artifact metadata and optional explicitly requested bodies.
Implementations§
Source§impl ContextExport
impl ContextExport
Sourcepub fn from_parts(
session_id: impl Into<String>,
ledger: &ContextLedger,
accounting: Option<ProviderRequestAccounting>,
artifacts: Vec<ExportArtifact>,
diagnostics: Vec<String>,
) -> Self
pub fn from_parts( session_id: impl Into<String>, ledger: &ContextLedger, accounting: Option<ProviderRequestAccounting>, artifacts: Vec<ExportArtifact>, diagnostics: Vec<String>, ) -> Self
Build a redacted export from one ledger and the selected request.
Sourcepub fn to_json(&self) -> Result<String, Error>
pub fn to_json(&self) -> Result<String, Error>
Serialize this export as deterministic pretty JSON.
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
Render this same typed export as deterministic Markdown.
Trait Implementations§
Source§impl Clone for ContextExport
impl Clone for ContextExport
Source§fn clone(&self) -> ContextExport
fn clone(&self) -> ContextExport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContextExport
impl Debug for ContextExport
Source§impl<'de> Deserialize<'de> for ContextExport
impl<'de> Deserialize<'de> for ContextExport
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ContextExport
Source§impl PartialEq for ContextExport
impl PartialEq for ContextExport
Source§impl Serialize for ContextExport
impl Serialize for ContextExport
impl StructuralPartialEq for ContextExport
Auto Trait Implementations§
impl Freeze for ContextExport
impl RefUnwindSafe for ContextExport
impl Send for ContextExport
impl Sync for ContextExport
impl Unpin for ContextExport
impl UnsafeUnpin for ContextExport
impl UnwindSafe for ContextExport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.