pub struct Flow { /* private fields */ }Expand description
A compiled flow. Compile it once with Flow::compile, store it with
Flow::to_bytes and load it with Flow::from_bytes. It is immutable
and can be shared between threads.
Implementations§
Source§impl Flow
impl Flow
Source§impl Flow
impl Flow
Sourcepub fn hash(&self) -> String
pub fn hash(&self) -> String
The flow’s version as hex. It changes when what the flow does changes, and not when only its layout, comments or annotations do.
Sourcepub fn events(&self) -> impl Iterator<Item = &str>
pub fn events(&self) -> impl Iterator<Item = &str>
Declared events. tick is always accepted too.
Sourcepub fn asks(&self) -> impl Iterator<Item = &str>
pub fn asks(&self) -> impl Iterator<Item = &str>
Every ask name the flow can produce, e.g. to check that the host resolves each of them before deploying.
Sourcepub fn annotations(&self) -> &[Annotation]
pub fn annotations(&self) -> &[Annotation]
The annotations on the flow declaration.
Sourcepub fn warnings(&self) -> &[Diagnostic]
pub fn warnings(&self) -> &[Diagnostic]
Problems that didn’t stop the flow compiling.
Sourcepub fn source(&self) -> &str
pub fn source(&self) -> &str
The source the flow was compiled from, for reports such as
RunError::report.
Source§impl Flow
impl Flow
Sourcepub fn rebind(&self, token: &Token) -> Result<Token, RebindError>
pub fn rebind(&self, token: &Token) -> Result<Token, RebindError>
Move a token to this version of the flow: its node must still exist, take as many arguments, and continue an ask exactly when the token waits on one, and each param it carries must still exist. The instance stays where it was, with the same sequence number.
Arguments travel by position, so a node whose parameters were renamed or reordered takes them as they were. The host decides when rebinding is safe, e.g. after fixing a flow that failed mid-instance.
Source§impl Flow
impl Flow
Sourcepub fn run(&self, input: Input, limits: &Limits) -> Result<Decision, InputError>
pub fn run(&self, input: Input, limits: &Limits) -> Result<Decision, InputError>
Run the flow once. Err means the host passed something wrong and
nothing ran; every other ending is a Decision.
Sourcepub fn run_traced(
&self,
input: Input,
limits: &Limits,
) -> Result<(Decision, Trace), InputError>
pub fn run_traced( &self, input: Input, limits: &Limits, ) -> Result<(Decision, Trace), InputError>
Like run, also returning the path the run took.