Skip to main content

RunJournal

Struct RunJournal 

Source
pub struct RunJournal { /* private fields */ }
Expand description

One run’s journal writer. A failed write stops further writes and is reported when the run ends.

Implementations§

Source§

impl RunJournal

Source

pub fn admit( session: Option<&mut Session>, config: Value, prompt: Value, model: (u64, u64), settings: Value, captured: &[(String, Value)], inbox: Value, ) -> Result<Self, String>

Admit a run of prompt with the lane config and the operation’s settings, placing the queued messages the admission takes ((entryId, message)) before the prompt and leaving inbox in the lane’s state (see Run::admit_with). --no-session runs pass no session and journal nothing.

Source

pub fn reopen( session: &Session, operation_id: &str, model: (u64, u64), ) -> Result<Self, String>

Continue the journal of the open operation operation_id (a run the durable runtime resumes).

Source

pub fn held_until(&self) -> Option<Instant>

Source

pub fn flush_held(&mut self, session: &mut Session)

Source

pub fn ledger_counts_turns(&mut self)

Leave counting responses to the usage ledger (see RunJournal::event).

Source

pub fn run(&self) -> Option<&Run>

The operation being journaled.

Source

pub fn event(&mut self, session: &mut Session, event: &AgentEvent)

Source

pub fn begin_with( &mut self, session: &mut Session, before: Vec<Write>, trigger: Option<String>, )

Begin a generation with before (the queued messages it takes) in its assistant.ready transaction.

Source

pub fn set_stream_options(&mut self, options: Value)

Source

pub fn set_retry_policy(&mut self, policy: Value)

Source

pub fn schedule_retry(&mut self, not_before: i64, error: String)

Source

pub fn set_inbox(&mut self, inbox: Value)

The lane’s queued messages as the run’s lane state lists them.

Source

pub fn request_cancel(&mut self, session: &mut Session, at: i64)

Record a cancel request at at (milliseconds).

Source

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

End a cancelled run (status aborted): its terminal transaction, also after an earlier write failed (the run ended; its operation must not stay open). Err: the terminal transaction did not commit; it may be committed again.

Source

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

End the run (failure: the error kind and message it ended with; an earlier write error ends it failed with that error). Err: the terminal transaction did not commit; it may be committed again.

Source

pub fn fail_configuration( self, session: &mut Session, code: &str, message: &str, details: Value, ) -> Result<(), String>

Source

pub fn compact_with_answer(&mut self, session: &Session, prepared: Value)

Source

pub fn begin_compaction( &mut self, session: &mut Session, reason: &str, prepared: Value, resume_after: Option<Value>, )

Source

pub fn compaction_request( &mut self, session: &mut Session, retry: &RetryPolicy, ) -> Option<String>

The summary request: returns the compaction entry’s id (none without a journal or after a write error).

Source

pub fn compaction_task_id(&self) -> Option<String>

The task id of the compaction in progress (the harness’s retry step).

Source

pub fn compaction_retry_wait( &mut self, session: &mut Session, usage: Option<&Value>, error: &str, not_before: i64, )

Source

pub fn compaction_retry(&mut self, session: &mut Session)

Source

pub fn compaction_usage(&mut self, session: &mut Session, usage: &Value)

Source

pub fn complete_compaction( &mut self, session: &mut Session, id: &str, entry: Map<String, Value>, )

Source

pub fn complete_compaction_from_hook( &mut self, session: &mut Session, entry: Map<String, Value>, usage: Option<Value>, ) -> Option<String>

See Run::complete_compaction_from_hook: the compaction entry’s id (none after a write error).

Source

pub fn decline_compaction( &mut self, session: &mut Session, placement: Vec<Write>, ) -> bool

See Run::decline_compaction; false also without a journal or after a write error.

Source

pub fn abandon_compaction(&mut self)

Source

pub fn error(&self) -> Option<&str>

The first write error so far.

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