mlua-periphery 1.2.4

A Rust-native implementation of lua-periphery for mlua.
1
2
3
4
5
6
7
8
9
10
11
12
use mlua::{Function, Lua};
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let lua = Lua::new();
    mlua_periphery::preload(&lua)?;

    let find_components = include_str!("find_components.lua");
    let the_fn: Function = lua.load(find_components).eval()?;
    the_fn.call::<()>("/dev/i2c-1")?;
    Ok(())
}