low-luajit 0.4.0

Low level but safe bindings to the LuaJIT C API with no dependencies and no-std support to create Lua modules using Rust.
Documentation
use crate::{LuaState, ffi};

/*
#[repr(i32)]
#[derive(Debug)]
pub enum ThreadStatus {
	/// This thread is operational.
	Ok = ffi::LUA_OK,

	/// This thread is suspended.
	Yielded = ffi::LUA_YIELD,

	/// This thread encountered an error while running.
	RuntimeError = ffi::LUA_ERRRUN,


}*/

/// Thread related functions.
impl LuaState {
	/// Returns `true` if the value at the given acceptable `index` is a thread, `false` otherwise.
	#[inline]
	#[must_use]
	pub fn is_thread(&self, index: i32) -> bool {
		// SAFETY: self.0 is always valid.
		unsafe { ffi::lua_isthread(self.0, index) != 0 }
	}

	/// Pushes the thread represented by this `LuaState` onto the stack.
	///
	/// Returns `true` if this thread is the main thread of its state, `false` otherwise.
	#[inline]
	pub fn push_thread(&mut self) -> bool {
		// SAFETY: self.0 is always valid.
		unsafe { ffi::lua_pushthread(self.0) != 0 }
	}
}