pub struct Runtime<'a> { /* private fields */ }Expand description
One run in progress.
Implementations§
Source§impl<'a> Runtime<'a>
impl<'a> Runtime<'a>
Sourcepub async fn start(
store: &'a Store,
plan: &'a CompiledPlan,
agents: &'a dyn Agents,
workflow: &str,
) -> Result<Self, RuntimeError>
pub async fn start( store: &'a Store, plan: &'a CompiledPlan, agents: &'a dyn Agents, workflow: &str, ) -> Result<Self, RuntimeError>
Starts a new run and records that it started.
Sourcepub async fn resume(
store: &'a Store,
plan: &'a CompiledPlan,
agents: &'a dyn Agents,
run: RunId,
in_doubt: InDoubt,
) -> Result<Self, RuntimeError>
pub async fn resume( store: &'a Store, plan: &'a CompiledPlan, agents: &'a dyn Agents, run: RunId, in_doubt: InDoubt, ) -> Result<Self, RuntimeError>
Picks up a run from its journal.
Nodes that recorded an exit are not run again; their outputs are read
back from what they wrote. in_doubt answers the one case that cannot be
settled from the record — and it is only consulted for node types that
say repeating them is unsafe.
pub fn id(&self) -> &RunId
Sourcepub async fn run(&mut self) -> Result<(), RuntimeError>
pub async fn run(&mut self) -> Result<(), RuntimeError>
Runs to the end, or to the first thing that stops it.
Sourcepub async fn step(&mut self) -> Result<Progress, RuntimeError>
pub async fn step(&mut self) -> Result<Progress, RuntimeError>
Runs one node.
The unit a run is killed and resumed at, and the unit a debugger steps by — the same primitive, because a breakpoint and a crash leave the journal in exactly the same shape.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Runtime<'a>
impl<'a> !Sync for Runtime<'a>
impl<'a> !UnwindSafe for Runtime<'a>
impl<'a> Freeze for Runtime<'a>
impl<'a> Send for Runtime<'a>
impl<'a> Unpin for Runtime<'a>
impl<'a> UnsafeUnpin for Runtime<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.