#[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
UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
A context compaction upsert. The first update 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 retained summary. A non-empty summary is only
valid with completed; error is only valid with failed.
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 retained by the compaction.
error: MaybeUndefined<String>Human-readable description of why the compaction failed.
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
Available on crate feature unstable_session_compaction only.
pub fn new( compaction_id: impl Into<CompactionId>, status: CompactionStatus, ) -> Self
unstable_session_compaction only.Builds a compaction update with optional patch fields omitted.
Sourcepub fn summary(
self,
summary: impl IntoMaybeUndefined<Vec<ContentBlock>>,
) -> Self
Available on crate feature unstable_session_compaction only.
pub fn summary( self, summary: impl IntoMaybeUndefined<Vec<ContentBlock>>, ) -> Self
unstable_session_compaction only.Sets, clears, or omits the complete retained summary patch.
Sourcepub fn error(self, error: impl IntoMaybeUndefined<String>) -> Self
Available on crate feature unstable_session_compaction only.
pub fn error(self, error: impl IntoMaybeUndefined<String>) -> Self
unstable_session_compaction only.Sets, clears, or omits the failure description patch.
Sourcepub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
Available on crate feature unstable_session_compaction only.
pub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
unstable_session_compaction only.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<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