pub struct CompactionOp {
pub result_entry_id: String,
/* private fields */
}Expand description
One structural operation in progress: a compaction, or a navigation (with or without a branch summary).
Fields§
§result_entry_id: StringImplementations§
Source§impl CompactionOp
impl CompactionOp
pub fn operation_id(&self) -> &str
Sourcepub fn begin(
session: &mut Session,
preparation: &CompactionPreparation,
retained_tail: &[Value],
custom_instructions: Option<&str>,
) -> Result<CompactionOp, String>
pub fn begin( session: &mut Session, preparation: &CompactionPreparation, retained_tail: &[Value], custom_instructions: Option<&str>, ) -> Result<CompactionOp, String>
Admit the operation with its preparation (retained_tail: the kept messages): summary.deciding, where the
session_before_compact hook decides before any request (CompactionOp::request).
Admit a summarized navigation to target with its preparation (preparation: the branch left, as
prepareBranchEntries reduces it): summary.deciding with a commit_navigation boundary, where the
session_before_tree hook decides before any request.
Admit a navigation without a summary: navigation.ready_to_commit (CompactionOp::commit_navigation);
its label goes on label_entry (default: the target).
Commit a navigation without a summary: the tip moves to the target (labelled) and the operation ends.
Commit the branch summary entry (without id, parent and fromId) under the target as the new tip, its
label on the summary (AgentSession navigateTree), and end the operation; usage: a hook’s summary usage,
recorded as a usage row (a model summary’s row was recorded with its response).
Sourcepub fn decline(self, session: &mut Session) -> Result<(), String>
pub fn decline(self, session: &mut Session) -> Result<(), String>
End the operation declined (a session_before_tree hook cancelled the navigation); the branch is
unchanged.
Sourcepub fn request(
&mut self,
session: &mut Session,
retry: RetryPolicy,
) -> Result<(), String>
pub fn request( &mut self, session: &mut Session, retry: RetryPolicy, ) -> Result<(), String>
Prepare the summary request under retry: summary.ready, summary.effect_pending, and the request with
its usage id.
Sourcepub fn retry_wait(
&mut self,
session: &mut Session,
usage: Option<&Value>,
error: &str,
not_before: i64,
) -> Result<(), String>
pub fn retry_wait( &mut self, session: &mut Session, usage: Option<&Value>, error: &str, not_before: i64, ) -> Result<(), String>
A retryable failed attempt (publishAttemptResult): its response’s usage row (when it reported one) and
summary.retry_wait until not_before with the next attempt and the error.
Sourcepub fn retry(&mut self, session: &mut Session) -> Result<(), String>
pub fn retry(&mut self, session: &mut Session) -> Result<(), String>
The wait ended (runStructuralRetryWait): the next attempt’s summary.ready, summary.effect_pending and
request.
Sourcepub fn record_usage(
&self,
session: &mut Session,
usage: &Value,
) -> Result<(), String>
pub fn record_usage( &self, session: &mut Session, usage: &Value, ) -> Result<(), String>
The summary response arrived: its usage row, with the state that lists it.
Sourcepub fn complete(
self,
session: &mut Session,
entry: Map<String, Value>,
) -> Result<String, String>
pub fn complete( self, session: &mut Session, entry: Map<String, Value>, ) -> Result<String, String>
Commit the compaction entry (entry without id and parent) as the new tip and end the operation.