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§
Sourcefn 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,
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§
Sourcefn type_name(&self) -> &str
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.
Sourcefn input_ports(&self) -> Vec<PortIndex> ⓘ
fn input_ports(&self) -> Vec<PortIndex> ⓘ
Dataflow profile: the unique indices of input ports required for execution (empty for pure control-flow nodes).
Sourcefn output_ports(&self) -> Vec<PortIndex> ⓘ
fn output_ports(&self) -> Vec<PortIndex> ⓘ
Dataflow profile: the unique indices of output ports produced upon success.
Sourcefn is_dynamic_output(&self) -> bool
fn is_dynamic_output(&self) -> bool
Indicates whether output ports are evaluated dynamically at runtime.
Sourcefn activation(&self) -> Activation
fn activation(&self) -> Activation
How this node joins a frontier. Default: Activation::Any (control-flow).
Sourcefn recovery(&self) -> RecoveryPolicy
fn recovery(&self) -> RecoveryPolicy
Per-node recovery policy. Default: fail-fast (first error aborts the run).
Sourcefn merger(&self) -> Option<&str>
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.
Sourcefn max_executions(&self) -> Option<u64>
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>>
impl<S: Send> BspNode<S> for Box<dyn BspNode<S>>
Source§fn type_name(&self) -> &str
fn type_name(&self) -> &str
"my-crate.generate".
Defaults to BspNode::name; override for stable cross-version identity.Source§fn input_ports(&self) -> Vec<PortIndex> ⓘ
fn input_ports(&self) -> Vec<PortIndex> ⓘ
Source§fn output_ports(&self) -> Vec<PortIndex> ⓘ
fn output_ports(&self) -> Vec<PortIndex> ⓘ
Source§fn is_dynamic_output(&self) -> bool
fn is_dynamic_output(&self) -> bool
Source§fn activation(&self) -> Activation
fn activation(&self) -> Activation
Activation::Any (control-flow).Source§fn recovery(&self) -> RecoveryPolicy
fn recovery(&self) -> RecoveryPolicy
Source§fn merger(&self) -> Option<&str>
fn merger(&self) -> Option<&str>
crate::merge::Merger used when this
node joins concurrently produced branch states at a superstep barrier.Source§fn max_executions(&self) -> Option<u64>
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,
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,
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".