Skip to main content

Node

Trait Node 

Source
pub trait Node:
    Send
    + Sync
    + Debug {
    // Required method
    fn run(&self, ctx: NodeContext) -> BoxFuture<'_, NodeResult>;

    // Provided methods
    fn role(&self) -> NodeRole { ... }
    fn inputs(&self) -> Vec<Selector> { ... }
}
Expand description

An executable node.

Required Methods§

Source

fn run(&self, ctx: NodeContext) -> BoxFuture<'_, NodeResult>

Execute the node. Dropping the returned future cancels the node.

Provided Methods§

Source

fn role(&self) -> NodeRole

Scheduling role. Must be constant for a given instance.

Source

fn inputs(&self) -> Vec<Selector>

Selectors this node reads. crate::graph::Graph::build rejects selectors whose namespace is neither a node id nor sys / env / conversation (catching typos at load time) and warns about references into other container bodies. Return every selector the node may read, including placeholders inside templates.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§