Skip to main content

FlowBuilder

Struct FlowBuilder 

Source
pub struct FlowBuilder { /* private fields */ }
Expand description

Builder for creating Flow instances with reduced boilerplate.

Implementations§

Source§

impl FlowBuilder

Source

pub fn new() -> Self

Create a new FlowBuilder with default values.

Source

pub fn name<S: Into<String>>(self, name: S) -> Self

Set the flow name.

Source

pub fn description<S: Into<String>>(self, desc: S) -> Self

Set the flow description.

Source

pub fn version<S: Into<String>>(self, version: S) -> Self

Set the flow version.

Source

pub fn input_schema(self, schema: SchemaRef) -> Self

Set the input schema.

Source

pub fn output_schema(self, schema: SchemaRef) -> Self

Set the output schema.

Source

pub fn step(self, step: Step) -> Self

Add a single step to the flow.

Source

pub fn steps<I: IntoIterator<Item = Step>>(self, steps: I) -> Self

Add multiple steps to the flow.

Source

pub fn output(self, output: ValueExpr) -> Self

Set the flow output.

Source

pub fn variables(self, variables: VariableSchema) -> Self

Set the variables schema for the flow.

Source

pub fn test_config(self, test: TestConfig) -> Self

Set the test configuration.

Source

pub fn examples(self, examples: Vec<ExampleInput>) -> Self

Set the examples.

Source

pub fn metadata<S: Into<String>>(self, key: S, value: Value) -> Self

Add metadata.

Source

pub fn test_flow() -> Self

Create a builder for a test flow with a default name.

Source

pub fn mock_flow() -> Self

Create a builder for a mock flow with common test defaults.

Source

pub fn build(self) -> Flow

Build the final Flow instance.

Trait Implementations§

Source§

impl Default for FlowBuilder

Source§

fn default() -> FlowBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Erased for T