Trait FlowNode

Source
pub trait FlowNode {
    type Request: Serialize + DeserializeOwned;

    // Required methods
    fn imports(ctx: &mut ImportCtx<'_>);
    fn emit(
        requests: Vec<Self::Request>,
        ctx: &mut NodeCtx<'_>,
    ) -> Result<(), Error>;
}
Expand description

TODO: clearly verbalize what a FlowNode encompasses

Required Associated Types§

Source

type Request: Serialize + DeserializeOwned

TODO: clearly verbalize what a Request encompasses

Required Methods§

Source

fn imports(ctx: &mut ImportCtx<'_>)

A list of nodes that this node is capable of taking a dependency on.

Attempting to take a dep on a node that wasn’t imported via this method will result in an error during flow resolution time.


To put it bluntly: This is boilerplate.

We (the flowey devs) are thinking about ways to avoid requiring this method, but do not have a good solution at this time.

Source

fn emit( requests: Vec<Self::Request>, ctx: &mut NodeCtx<'_>, ) -> Result<(), Error>

Given a set of incoming requests, emit various steps to run, set various dependencies, etc…

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§