#[non_exhaustive]pub struct CompactionUpdate {
pub compaction_id: CompactionId,
pub status: CompactionStatus,
pub summary: MaybeUndefined<Vec<ContentBlock>>,
pub error: MaybeUndefined<String>,
pub meta: MaybeUndefined<Meta>,
}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<Meta>Extensible metadata patch for this compaction.
Implementations§
Source§impl CompactionUpdate
impl CompactionUpdate
Sourcepub fn new(
compaction_id: impl Into<CompactionId>,
status: CompactionStatus,
) -> Self
pub fn new( compaction_id: impl Into<CompactionId>, status: CompactionStatus, ) -> Self
Builds a compaction update with optional patch fields omitted.
Sourcepub fn summary(
self,
summary: impl IntoMaybeUndefined<Vec<ContentBlock>>,
) -> Self
pub fn summary( self, summary: impl IntoMaybeUndefined<Vec<ContentBlock>>, ) -> Self
Sets, clears, or omits the complete retained summary patch.
Sourcepub fn error(self, error: impl IntoMaybeUndefined<String>) -> Self
pub fn error(self, error: impl IntoMaybeUndefined<String>) -> Self
Sets, clears, or omits the error details patch.
Sourcepub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
pub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
Sets, clears, or omits the metadata patch.
Trait Implementations§
Source§impl Clone for CompactionUpdate
impl Clone for CompactionUpdate
Source§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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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