Skip to main content

ScriptContext

Trait ScriptContext 

Source
pub trait ScriptContext: Send {
    // Required methods
    fn label(&self) -> &str;
    fn actor_json(&self) -> &Value;
}
Expand description

Opaque execution context for script handlers.

The runtime passes this as the first argument to #[chronon::script] handlers and to registered invoke functions. Use label for logs and actor_json when the handler only needs the captured actor payload.

Required Methods§

Source

fn label(&self) -> &str

Debug label for logs and tests.

Source

fn actor_json(&self) -> &Value

Actor JSON captured at schedule time and restored at dispatch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§