Skip to main content

BspNode

Trait BspNode 

Source
pub trait BspNode<S>: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn execute<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        run: &'life1 mut RunContext<'life2, S>,
    ) -> Pin<Box<dyn Future<Output = Result<NodeOutcome, BspError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn type_name(&self) -> &str { ... }
    fn input_ports(&self) -> Vec<PortIndex> ⓘ { ... }
    fn output_ports(&self) -> Vec<PortIndex> ⓘ { ... }
    fn is_dynamic_output(&self) -> bool { ... }
    fn activation(&self) -> Activation { ... }
    fn recovery(&self) -> RecoveryPolicy { ... }
    fn merger(&self) -> Option<&str> { ... }
    fn max_executions(&self) -> Option<u64> { ... }
}
Expand description

The programmatic contract for writing execution nodes.

S is the consumer-owned run state: the engine is generic over it and never inspects it except through explicitly defined lenses (conditions, mergers). Implementors get control-flow defaults; the #[node] / #[node_blocking] macros generate dataflow profile nodes (Activation::All, named ports) over this same trait.

Required Methods§

Source

fn name(&self) -> &str

Semantic name used for logs, interceptors, and the GUI.

Source

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run: &'life1 mut RunContext<'life2, S>, ) -> Pin<Box<dyn Future<Output = Result<NodeOutcome, BspError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Core computation. Mutates state and the value store through run; the engine decides what happens next from the edges — nodes never name their successors.

Provided Methods§

Source

fn type_name(&self) -> &str

Registry type name used for (de)serialization, e.g. "my-crate.generate". Defaults to BspNode::name; override for stable cross-version identity.

Source

fn input_ports(&self) -> Vec<PortIndex> ⓘ

Dataflow profile: the unique indices of input ports required for execution (empty for pure control-flow nodes).

Source

fn output_ports(&self) -> Vec<PortIndex> ⓘ

Dataflow profile: the unique indices of output ports produced upon success.

Source

fn is_dynamic_output(&self) -> bool

Indicates whether output ports are evaluated dynamically at runtime.

Source

fn activation(&self) -> Activation

How this node joins a frontier. Default: Activation::Any (control-flow).

Source

fn recovery(&self) -> RecoveryPolicy

Per-node recovery policy. Default: fail-fast (first error aborts the run).

Source

fn merger(&self) -> Option<&str>

Optional name of a consumer-registered crate::merge::Merger used when this node joins concurrently produced branch states at a superstep barrier.

Source

fn max_executions(&self) -> Option<u64>

Optional circuit breaker on how many times this node may execute per run (poll-until style nodes).

Trait Implementations§

Source§

impl<S: Send> BspNode<S> for Box<dyn BspNode<S>>

Source§

fn name(&self) -> &str

Semantic name used for logs, interceptors, and the GUI.
Source§

fn type_name(&self) -> &str

Registry type name used for (de)serialization, e.g. "my-crate.generate". Defaults to BspNode::name; override for stable cross-version identity.
Source§

fn input_ports(&self) -> Vec<PortIndex> ⓘ

Dataflow profile: the unique indices of input ports required for execution (empty for pure control-flow nodes).
Source§

fn output_ports(&self) -> Vec<PortIndex> ⓘ

Dataflow profile: the unique indices of output ports produced upon success.
Source§

fn is_dynamic_output(&self) -> bool

Indicates whether output ports are evaluated dynamically at runtime.
Source§

fn activation(&self) -> Activation

How this node joins a frontier. Default: Activation::Any (control-flow).
Source§

fn recovery(&self) -> RecoveryPolicy

Per-node recovery policy. Default: fail-fast (first error aborts the run).
Source§

fn merger(&self) -> Option<&str>

Optional name of a consumer-registered crate::merge::Merger used when this node joins concurrently produced branch states at a superstep barrier.
Source§

fn max_executions(&self) -> Option<u64>

Optional circuit breaker on how many times this node may execute per run (poll-until style nodes).
Source§

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run: &'life1 mut RunContext<'life2, S>, ) -> Pin<Box<dyn Future<Output = Result<NodeOutcome, BspError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Core computation. Mutates state and the value store through run; the engine decides what happens next from the edges — nodes never name their successors.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<S: Send> BspNode<S> for Box<dyn BspNode<S>>

Source§

fn name(&self) -> &str

Source§

fn type_name(&self) -> &str

Source§

fn input_ports(&self) -> Vec<PortIndex> ⓘ

Source§

fn output_ports(&self) -> Vec<PortIndex> ⓘ

Source§

fn is_dynamic_output(&self) -> bool

Source§

fn activation(&self) -> Activation

Source§

fn recovery(&self) -> RecoveryPolicy

Source§

fn merger(&self) -> Option<&str>

Source§

fn max_executions(&self) -> Option<u64>

Source§

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run: &'life1 mut RunContext<'life2, S>, ) -> Pin<Box<dyn Future<Output = Result<NodeOutcome, BspError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§

Source§

impl<S: Send, T: DataflowNode> BspNode<S> for T