pub struct Lua<'lua> { /* private fields */ }Expand description
A Lua state with the standard libraries installed.
The 'lua parameter mirrors hlua’s signature so consumer code that writes
Lua<'a> keeps compiling; the shim itself owns its state outright.
Implementations§
Source§impl<'lua> Lua<'lua>
impl<'lua> Lua<'lua>
Sourcepub fn new() -> Lua<'lua>
pub fn new() -> Lua<'lua>
Create a new Lua state with the standard libraries installed. Panics
only on allocation failure, matching the effective behaviour of
hlua::Lua::new().
Sourcepub fn open_string(&mut self)
pub fn open_string(&mut self)
Open the string library. lua-rs already opens the full standard library at construction, so this is a no-op kept for API compatibility.
Sourcepub fn execute<T: FromExec>(&mut self, code: &str) -> Result<T, LuaError>
pub fn execute<T: FromExec>(&mut self, code: &str) -> Result<T, LuaError>
Load and run a chunk of Lua source.
Trait Implementations§
Auto Trait Implementations§
impl<'lua> Freeze for Lua<'lua>
impl<'lua> !RefUnwindSafe for Lua<'lua>
impl<'lua> !Send for Lua<'lua>
impl<'lua> !Sync for Lua<'lua>
impl<'lua> Unpin for Lua<'lua>
impl<'lua> UnsafeUnpin for Lua<'lua>
impl<'lua> !UnwindSafe for Lua<'lua>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more