Docs.rs
  • actix-lua-0.7.0
    • actix-lua 0.7.0
    • Permalink
    • Docs.rs crate page
    • MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • poga
    • Dependencies
      • actix ^0.7 normal
      • futures ^0.1 normal
      • regex ^1 normal
      • rlua ^0.16 normal
      • tokio ^0.1 normal
      • uuid ^0.6 normal
      • futures-timer ^0.1 dev
    • Versions
    • 28.57% of the crate is documented
  • Platform
    • i686-unknown-linux-gnu
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate actix_lua

actix_lua0.7.0

  • All Items

Sections

  • actix-lua: Lua scripting for actix
  • The LuaActor object
  • The LuaMessage type

Crate Items

  • Modules
  • Structs
  • Enums

Crates

  • actix_lua

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§

dev
Re-export rlua interface for library developers

Structs§

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

Enums§

LuaMessage

Results

Settings
Help
    struct
    actix_lua::dev::rlua::Thread
    Handle to an internal Lua thread (or coroutine).
    enum variant
    actix_lua::dev::rlua::Value::Thread
    Reference to a Lua thread (or coroutine).
    enum variant
    actix_lua::LuaMessage::ThreadYield
    enum
    actix_lua::dev::rlua::ThreadStatus
    Status of a Lua thread (or coroutine).
    struct
    actix_lua::dev::rlua::prelude::LuaThread
    Handle to an internal Lua thread (or coroutine).
    enum
    actix_lua::dev::rlua::prelude::LuaThreadStatus
    Status of a Lua thread (or coroutine).
    method
    actix_lua::dev::rlua::Context::create_thread
    Wraps a Lua function into a new thread (or coroutine).
    method
    actix_lua::dev::rlua::Context::current_thread
    Returns a handle to the active Thread for this Context. …
    method
    actix_lua::dev::rlua::Thread::clone
    &Thread -> Thread
    method
    actix_lua::dev::rlua::Thread::status
    &Thread -> ThreadStatus
    Gets the status of the thread.
    method
    actix_lua::dev::rlua::Thread::to_lua
    Thread, Context -> Result<Value, Error>
    method
    actix_lua::dev::rlua::Thread::fmt
    &Thread, &mut Formatter -> Result<(), Error>
    method
    actix_lua::dev::rlua::Thread::resume
    &Thread, A -> Result<R, Error>
    Resumes execution of this thread.
    method
    actix_lua::dev::rlua::Context::current_thread
    Context -> Thread
    Returns a handle to the active Thread for this Context. …
    method
    actix_lua::dev::rlua::Thread::from_lua
    Value, Context -> Result<Thread, Error>
    method
    actix_lua::dev::rlua::Context::create_thread
    Context, Function -> Result<Thread, Error>
    Wraps a Lua function into a new thread (or coroutine).
    method
    actix_lua::dev::rlua::Thread::clone
    &Thread -> Thread