Skip to main content

CompactionOp

Struct CompactionOp 

Source
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: String

Implementations§

Source§

impl CompactionOp

Source

pub fn operation_id(&self) -> &str

Source

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).

Source

pub fn begin_navigation( session: &mut Session, target: Option<&str>, preparation: &BranchPreparation, custom_instructions: Option<&str>, label: Option<&str>, ) -> Result<CompactionOp, String>

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.

Source

pub fn begin_direct_navigation( session: &mut Session, target: Option<&str>, label: Option<&str>, label_entry: Option<&str>, ) -> Result<CompactionOp, String>

Admit a navigation without a summary: navigation.ready_to_commit (CompactionOp::commit_navigation); its label goes on label_entry (default: the target).

Source

pub fn commit_navigation( self, session: &mut Session, ) -> Result<Option<String>, String>

Commit a navigation without a summary: the tip moves to the target (labelled) and the operation ends.

Source

pub fn complete_navigation( self, session: &mut Session, entry: Map<String, Value>, hook_usage: Option<Value>, ) -> Result<String, String>

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).

Source

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.

Source

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.

Source

pub fn task_id(&self) -> &str

The summary task’s id (the harness’s retry step).

Source

pub fn attempt(&self) -> u64

The summary attempt in progress (1-based).

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn abort(self, session: &mut Session) -> Result<(), String>

End the operation as aborted (a cancel request, or a hook that cancelled it); the branch is unchanged.

Source

pub fn fail(self, session: &mut Session, message: &str) -> Result<(), String>

End the operation as failed; the branch is unchanged.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more