pub struct Workflow { /* private fields */ }Expand description
A symbolic computation graph under construction.
Implementations§
Source§impl Workflow
impl Workflow
Sourcepub fn compile(&self) -> Result<CompiledWorkflow, WorkflowError>
pub fn compile(&self) -> Result<CompiledWorkflow, WorkflowError>
Validates and optimizes this graph into a reusable physical plan.
Compilation performs type and cycle validation, stable topological ordering, common-subexpression elimination, dead-node elimination, output-lifetime planning and a conservative memory estimate.
§Errors
Returns an error for a graph with no outputs, an invalid dependency, an incompatible dependency type or a cycle.
Source§impl Workflow
impl Workflow
Sourcepub fn input<T: Send + Sync + 'static>(
&mut self,
name: impl Into<Box<str>>,
cost: Cost,
) -> Result<Input<T>, WorkflowBuildError>
pub fn input<T: Send + Sync + 'static>( &mut self, name: impl Into<Box<str>>, cost: Cost, ) -> Result<Input<T>, WorkflowBuildError>
Declares a typed named input.
§Errors
Returns an error when the name is empty or already used by an input.
Sourcepub fn map<A, T, F>(
&mut self,
input: Node<A>,
metadata: OperationMetadata,
kernel: F,
) -> Result<Node<T>, WorkflowBuildError>where
A: Send + Sync + 'static,
T: Send + Sync + 'static,
F: Fn(&A, &ExecutionContext) -> WorkflowResult<T> + Send + Sync + 'static,
pub fn map<A, T, F>(
&mut self,
input: Node<A>,
metadata: OperationMetadata,
kernel: F,
) -> Result<Node<T>, WorkflowBuildError>where
A: Send + Sync + 'static,
T: Send + Sync + 'static,
F: Fn(&A, &ExecutionContext) -> WorkflowResult<T> + Send + Sync + 'static,
Sourcepub fn map2<A, B, T, F>(
&mut self,
first: Node<A>,
second: Node<B>,
metadata: OperationMetadata,
kernel: F,
) -> Result<Node<T>, WorkflowBuildError>
pub fn map2<A, B, T, F>( &mut self, first: Node<A>, second: Node<B>, metadata: OperationMetadata, kernel: F, ) -> Result<Node<T>, WorkflowBuildError>
Adds one typed binary operation.
§Errors
Returns an error when either input belongs to another workflow.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Workflow
impl !UnwindSafe for Workflow
impl Freeze for Workflow
impl Send for Workflow
impl Sync for Workflow
impl Unpin for Workflow
impl UnsafeUnpin for Workflow
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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