luajit 0.1.1

Rust crate for calling LuaJIT from Rust
Documentation
  • Coverage
  • 17.93%
    59 out of 329 items documented6 out of 95 items with examples
  • Size
  • Source code size: 55.55 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 10.2 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Documentation
  • Dreae/luajit-rs
    11 2 3
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Dreae

Luajit RS

Documentation

Crate for interfacing with LuaJIT from Rust, for running high-performance Lua code that can integrate with native-code written in rust.

Getting Started

#[macro_use]
extern crate luajit;

use luajit::{c_int, State};

fn return_42(state: &mut State) -> c_int {
    state.push(42);

    1
}

pub fn main() {
    let mut state = State::new();
    state.open_libs();
    state.do_string(r#"print("Hello world!")"#);

    state.push(lua_fn!(return_42));
    state.set_global("return_42");
    state.do_string(r#"print(return_42())"#);
}