Skip to main content

ActorExecutor

Trait ActorExecutor 

Source
pub trait ActorExecutor: Send + Sync {
    // Required methods
    fn execute(&self, actor_id: &ActorId, message: &Message) -> ExecutionResult;
    fn is_ready(&self, actor_id: &ActorId) -> bool;
    fn get_fuel(&self, actor_id: &ActorId) -> Option<u64>;
    fn reset(&self, actor_id: &ActorId) -> Result<()>;
}
Expand description

Trait for executing actor messages.

Implementations handle the actual invocation of actor code, whether through WASM, native code, or other mechanisms.

Required Methods§

Source

fn execute(&self, actor_id: &ActorId, message: &Message) -> ExecutionResult

Execute a message for an actor.

§Arguments
  • actor_id - The target actor’s ID
  • message - The message to process
§Returns

The result of execution

Source

fn is_ready(&self, actor_id: &ActorId) -> bool

Check if an actor is ready to execute.

Source

fn get_fuel(&self, actor_id: &ActorId) -> Option<u64>

Get the fuel consumption for an actor.

Source

fn reset(&self, actor_id: &ActorId) -> Result<()>

Reset an actor’s execution state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§