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
impl RunJournal
Sourcepub fn admit(
session: Option<&mut Session>,
config: Value,
prompt: Value,
model: (u64, u64),
settings: Value,
captured: &[(String, Value)],
inbox: Value,
) -> Result<Self, String>
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.
Sourcepub fn reopen(
session: &Session,
operation_id: &str,
model: (u64, u64),
) -> Result<Self, String>
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).
pub fn held_until(&self) -> Option<Instant>
pub fn flush_held(&mut self, session: &mut Session)
Sourcepub fn ledger_counts_turns(&mut self)
pub fn ledger_counts_turns(&mut self)
Leave counting responses to the usage ledger (see RunJournal::event).
pub fn event(&mut self, session: &mut Session, event: &AgentEvent)
Sourcepub fn begin_with(
&mut self,
session: &mut Session,
before: Vec<Write>,
trigger: Option<String>,
)
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.
pub fn set_stream_options(&mut self, options: Value)
pub fn set_retry_policy(&mut self, policy: Value)
pub fn schedule_retry(&mut self, not_before: i64, error: String)
Sourcepub fn set_inbox(&mut self, inbox: Value)
pub fn set_inbox(&mut self, inbox: Value)
The lane’s queued messages as the run’s lane state lists them.
Sourcepub fn request_cancel(&mut self, session: &mut Session, at: i64)
pub fn request_cancel(&mut self, session: &mut Session, at: i64)
Record a cancel request at at (milliseconds).
Sourcepub fn finish_aborted(&self, session: &mut Session) -> Result<(), String>
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.
Sourcepub fn finish(
&self,
session: Option<&mut Session>,
failure: Option<(&str, &str)>,
) -> Result<(), String>
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.
pub fn fail_configuration( self, session: &mut Session, code: &str, message: &str, details: Value, ) -> Result<(), String>
pub fn compact_with_answer(&mut self, session: &Session, prepared: Value)
pub fn begin_compaction( &mut self, session: &mut Session, reason: &str, prepared: Value, resume_after: Option<Value>, )
Sourcepub fn compaction_request(
&mut self,
session: &mut Session,
retry: &RetryPolicy,
) -> Option<String>
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).
Sourcepub fn compaction_task_id(&self) -> Option<String>
pub fn compaction_task_id(&self) -> Option<String>
The task id of the compaction in progress (the harness’s retry step).
pub fn compaction_retry_wait( &mut self, session: &mut Session, usage: Option<&Value>, error: &str, not_before: i64, )
pub fn compaction_retry(&mut self, session: &mut Session)
pub fn compaction_usage(&mut self, session: &mut Session, usage: &Value)
pub fn complete_compaction( &mut self, session: &mut Session, id: &str, entry: Map<String, Value>, )
Sourcepub fn complete_compaction_from_hook(
&mut self,
session: &mut Session,
entry: Map<String, Value>,
usage: Option<Value>,
) -> Option<String>
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).
Sourcepub fn decline_compaction(
&mut self,
session: &mut Session,
placement: Vec<Write>,
) -> bool
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.