pub struct Script { /* private fields */ }Expand description
A parsed workflow script.
Parsing is separate from running so that a script can be shown to the user for approval, and so that a bad script produces a diagnostic the model can act on before any agent starts.
Implementations§
Source§impl Script
impl Script
Sourcepub fn parse(source: &str) -> Result<Script, Diagnostic>
pub fn parse(source: &str) -> Result<Script, Diagnostic>
Parse source, or return the first error with the position that caused
it.
pub fn meta(&self) -> &Meta
pub fn source(&self) -> &str
Sourcepub fn declared_phases(&self) -> &[String]
pub fn declared_phases(&self) -> &[String]
Every phase title the run will show, in the order they first appear.
Titles declared in meta come first, then any phase() title the
script uses that meta did not declare.
Sourcepub fn estimated_agents(&self) -> Option<u32>
pub fn estimated_agents(&self) -> Option<u32>
How many agents the run will start, when that is knowable before it runs.
None means the count depends on data the script has not fetched yet,
such as a list of files an earlier agent returns. The approval prompt
says “unbounded” rather than guessing, because a number shown there has
to be one the user can rely on.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnsafeUnpin for Script
impl UnwindSafe for Script
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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 more