pub struct RunBuilder { /* private fields */ }Expand description
Builder for a script run.
Inputs may be supplied one-at-a-time with input (and the
document / documents ergonomic
shortcuts for doc-id references), or in bulk with inputs.
All merge into the same map; later writes to the same key overwrite earlier
ones.
let client = AkribesClient::builder("http://localhost:8080").token("tok").build();
let _run = client.project(1).executions().run("my_script")
.input("age", 25)
.input("tags", json!(["a", "b"]))
.document("resume", "doc_00000000-0000-0000-0000-000000000001")
.execute()
.await?;Implementations§
Source§impl RunBuilder
impl RunBuilder
Sourcepub fn script_name(&self) -> &str
pub fn script_name(&self) -> &str
The script this builder will run.
pub fn channel(self, channel: impl Into<String>) -> Self
Sourcepub fn inputs(self, inputs: HashMap<String, Value>) -> Self
pub fn inputs(self, inputs: HashMap<String, Value>) -> Self
Replace the inputs map in bulk. Merges into any previously-set inputs — entries with the same key are overwritten by this call.
Sourcepub fn input<V: Into<Value>>(self, name: impl Into<String>, value: V) -> Self
pub fn input<V: Into<Value>>(self, name: impl Into<String>, value: V) -> Self
Set one input. Overwrites any previous value for the same name.
Sourcepub fn document(
self,
name: impl Into<String>,
doc_id: impl Into<String>,
) -> Self
pub fn document( self, name: impl Into<String>, doc_id: impl Into<String>, ) -> Self
Convenience for setting a document-typed input from a doc_<uuid>
reference. The server resolves it to markdown before the workflow runs.
Inline content is no longer supported — use input name: markdown
for that.
Sourcepub fn documents<I, S>(self, name: impl Into<String>, doc_ids: I) -> Self
pub fn documents<I, S>(self, name: impl Into<String>, doc_ids: I) -> Self
Convenience for setting a list[document]-typed input from an iterable
of doc_<uuid> references. Each is resolved independently.
pub fn triggered_by(self, triggered_by: impl Into<String>) -> Self
pub fn breakpoint_lines(self, lines: Vec<usize>) -> Self
pub async fn execute(self) -> Result<RunResult>
pub async fn execute_and_await( self, timeout_ms: Option<u64>, ) -> Result<(String, ExecutionOutput)>
Trait Implementations§
Source§impl Clone for RunBuilder
impl Clone for RunBuilder
Source§fn clone(&self) -> RunBuilder
fn clone(&self) -> RunBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more