pub enum Edge {
Node {
task: usize,
locs: Locations,
at: Option<Location>,
input: HashMap<DataName, Option<AvailabilityKind>>,
result: Option<String>,
metadata: HashSet<Metadata>,
next: usize,
},
Linear {
instrs: Vec<EdgeInstr>,
next: usize,
},
Stop {},
Branch {
true_next: usize,
false_next: Option<usize>,
merge: Option<usize>,
},
Parallel {
branches: Vec<usize>,
merge: usize,
},
Join {
merge: MergeStrategy,
next: usize,
},
Loop {
cond: usize,
body: usize,
next: Option<usize>,
},
Call {
input: HashSet<DataName>,
result: HashSet<DataName>,
next: usize,
},
Return {
result: HashSet<DataName>,
},
}
Expand description
Defines an Edge (i.e., an intelligent control-flow operation) in the Workflow graph.
Is also referred to as an ‘Edge’ for historical reasons and because almost all of the elements are edge variants. In fact, the only Node is ‘Node’, which is why the rest doesn’t explicitly mentions it being an edge.
The edges can be thought of as a linked list of statements. However, each statement may secretly group multiple statements (instrucitons) to make reasoning about the graph easier.
Finally, the developers would like to formally apologize for completely butchering the term ‘Edge’.
Variants§
Node
A Node is an edge that runs a task. It has one input edge and one output edge.
Fields
at: Option<Location>
Annotation about where the task will be run. This is not meant to be populated by anyone except the planner.
input: HashMap<DataName, Option<AvailabilityKind>>
Reference to any input datasets/results that might be input to this node together with how they might be accessed. This latter part is populated during planning.
Linear
A Linear edge is simple a series of instructions that are run, after which is goes to one new edge.
Fields
Stop
A Stop is an edge that stops execution.
Branch
A Branching edge is an edge that branches into two possible (but disjoint) based on the result of a series of instructions.
§Stack layout
- Requires a boolean to be on top of the stack.
Fields
true_next: usize
The next edge to run if the condition returned ‘true’. Is not relative to the current program counter (i.e., if 0 is given, the first branch in the program is executed).
Parallel
A Parallel edge is an edge that branches into multiple branches that are all taken simultaneously.
Fields
Join
A Join edge is an edge that joins multiple branches into one, waiting until all have been completed.
Note that the execution of the join-edge acts like a fence, so is quite non-trivial.
Fields
merge: MergeStrategy
Defines the merge strategy of the Join, i.e., how to combine the results of the branches together.
Loop
Repeats a given set of edges indefinitely.
Fields
Call
A Calling edge is one that re-uses edges by executing the given edge instead. When done, the ‘next’ edge is pushed on the frame stack and popped when a Return edge is executed.
§Stack layout
- Requires a Function object to be on top of the stack which will be called.
- Requires N arguments of arbitrary type, where N is equal to the function object’s arity. The first argument of the function is at the bottom, the last second-to-top on the stack.
Fields
Return
A Returning edge is one that returns from a called edge by popping the next from the call stack.
§Stack layout
- Optionally requires a value to be on the stack of the called function’s return type. Whether or not this is need and which type that value has is determined by the top value on the frame stack.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Edge
impl<'de> Deserialize<'de> for Edge
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl EnumDebug for Edge
impl EnumDebug for Edge
source§fn type_name() -> &'static str
fn type_name() -> &'static str
source§fn variant_names() -> &'static [&'static str]
fn variant_names() -> &'static [&'static str]
source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
source§fn variant(&self) -> EnumDebugFormatter<'_, Self>
fn variant(&self) -> EnumDebugFormatter<'_, Self>
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnwindSafe for Edge
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request