#[non_exhaustive]pub struct CompactionUpdate {
pub compaction_id: CompactionId,
pub status: CompactionStatus,
pub summary: MaybeUndefined<Vec<ContentBlock>>,
pub error: MaybeUndefined<String>,
pub meta: MaybeUndefined<Map<String, Value>>,
}Expand description
A context compaction upsert. The first notification fixes the compaction’s
timeline position. Later updates with the same ID patch that entity in place.
Agents MUST only send this update when the Client advertised
ClientSessionCapabilities::compaction.
summary, error, and _meta have patch semantics: omission leaves the
stored value unchanged, null clears it, and a concrete value replaces it.
summary: [] also clears the summary.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.compaction_id: CompactionIdThe Agent-owned ID of this compaction, unique within the session.
status: CompactionStatusCurrent lifecycle status.
summary: MaybeUndefined<Vec<ContentBlock>>Complete replacement user-displayable summary content for the compaction.
error: MaybeUndefined<String>Human-readable error details for the compaction.
meta: MaybeUndefined<Map<String, Value>>Extensible metadata patch for this compaction.
Implementations§
Source§impl CompactionUpdate
impl CompactionUpdate
Sourcepub fn new(
compaction_id: impl Into<CompactionId>,
status: CompactionStatus,
) -> CompactionUpdate
pub fn new( compaction_id: impl Into<CompactionId>, status: CompactionStatus, ) -> CompactionUpdate
Builds a compaction update with optional patch fields omitted.
Sourcepub fn summary(
self,
summary: impl IntoMaybeUndefined<Vec<ContentBlock>>,
) -> CompactionUpdate
pub fn summary( self, summary: impl IntoMaybeUndefined<Vec<ContentBlock>>, ) -> CompactionUpdate
Sets, clears, or omits the complete retained summary patch.
Sourcepub fn error(self, error: impl IntoMaybeUndefined<String>) -> CompactionUpdate
pub fn error(self, error: impl IntoMaybeUndefined<String>) -> CompactionUpdate
Sets, clears, or omits the error details patch.
Sourcepub fn meta(
self,
meta: impl IntoMaybeUndefined<Map<String, Value>>,
) -> CompactionUpdate
pub fn meta( self, meta: impl IntoMaybeUndefined<Map<String, Value>>, ) -> CompactionUpdate
Sets, clears, or omits the metadata patch.
Trait Implementations§
Source§impl Clone for CompactionUpdate
impl Clone for CompactionUpdate
Source§fn clone(&self) -> CompactionUpdate
fn clone(&self) -> CompactionUpdate
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 CompactionUpdate
impl Debug for CompactionUpdate
Source§impl<'de> Deserialize<'de> for CompactionUpdate
impl<'de> Deserialize<'de> for CompactionUpdate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CompactionUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CompactionUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for CompactionUpdate
impl JsonSchema for CompactionUpdate
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more