pub struct Options { /* private fields */ }Expand description
Everything a run needs besides the description itself.
Built by chaining: Options::new().workflow("buyPet").input("petId", 7).
Implementations§
Source§impl Options
impl Options
Sourcepub fn new() -> Self
pub fn new() -> Self
Options with nothing set: the first workflow, no inputs, no source documents.
Sourcepub fn workflow(self, workflow_id: impl Into<String>) -> Self
pub fn workflow(self, workflow_id: impl Into<String>) -> Self
Run this workflow rather than the description’s first.
Sourcepub fn input(self, name: impl Into<String>, value: impl Into<Value>) -> Self
pub fn input(self, name: impl Into<String>, value: impl Into<Value>) -> Self
Set one workflow input.
Sourcepub fn source(
self,
name: impl Into<String>,
url: impl Into<String>,
document: Value,
) -> Self
pub fn source( self, name: impl Into<String>, url: impl Into<String>, document: Value, ) -> Self
Supply a source description: the name it was declared with, the
url it was declared with, and the parsed document.
Fetching documents is IO, which this crate leaves to its caller —
roas-file-fetcher and roas-http-fetcher do it for the loader
and do it here just as well.
Sourcepub fn base_url(
self,
source_name: impl Into<String>,
url: impl Into<String>,
) -> Self
pub fn base_url( self, source_name: impl Into<String>, url: impl Into<String>, ) -> Self
Send this source description’s requests somewhere else — a test server, a staging host — whatever its document says.
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Add a header to every request a step does not set itself.
Sourcepub fn max_steps(self, steps: usize) -> Self
pub fn max_steps(self, steps: usize) -> Self
The most steps a run may take before it is called a loop.
Sourcepub fn max_retries(self, retries: u32) -> Self
pub fn max_retries(self, retries: u32) -> Self
The most times one step may be retried.