Crate actix_lua

source ·
Expand description

actix-lua: Lua scripting for actix

The actix-lua crate provides a safe Lua programming language scripting enviroment for actix, an actor framework.

The LuaActor object

The main type exported by this library is the LuaActor struct.

You should create LuaActor with LuaActorBuilder.

extern crate actix_lua;
extern crate actix;

use actix_lua::{LuaActorBuilder};
use actix::Actor;

let addr = LuaActorBuilder::new()
    .on_handle_with_lua(r#"return ctx.msg + 42"#)
    .build()
    .unwrap()
    .start();

The LuaMessage type

LuaActor can only send/receive messages with type LuaMessage. It can be converted from/to primitive types such as i64, String, and HashMap with LuaMessage::from.

Modules

Structs

Top level struct which holds a lua state for itself.
LuaActorBuilder creates a new LuaActor with given Lua script.

Enums