Skip to main content

ComponentExec

Trait ComponentExec 

Source
pub trait ComponentExec {
    // Required method
    fn exec(
        &mut self,
        component: &str,
        ports: &[(String, Value)],
        bound: Option<&Value>,
    ) -> Option<ExecOutcome>;

    // Provided method
    fn exec_ctx(
        &mut self,
        node_id: &str,
        component: &str,
        ports: &[(String, Value)],
        bound: Option<&Value>,
    ) -> Option<ExecOutcome> { ... }
}
Expand description

The boundary-injected handler registry seam (§7.1). Resolves a catalog name to a leaf implementation and executes it with evaluated ports (+ the map element bound value, if any). Returns None when the name is unknown so run_behavior can fail closed with UNKNOWN_COMPONENT.

Required Methods§

Source

fn exec( &mut self, component: &str, ports: &[(String, Value)], bound: Option<&Value>, ) -> Option<ExecOutcome>

Provided Methods§

Source

fn exec_ctx( &mut self, node_id: &str, component: &str, ports: &[(String, Value)], bound: Option<&Value>, ) -> Option<ExecOutcome>

behaviorVersion 2: like ComponentExec::exec but carrying the handler ctx (node_id = body node id, component = catalog name). run_behavior calls this seam for every handler invocation. The default forwards to exec, so existing implementations keep working unchanged; override it to observe the node identity (error context / tracing).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§