pub struct Chunk<'lua> { /* private fields */ }Expand description
Builder returned by Lua::load, similar to mlua::Chunk.
Implementations§
Source§impl<'lua> Chunk<'lua>
impl<'lua> Chunk<'lua>
Sourcepub fn into_function(self) -> LuaResult<Function>
pub fn into_function(self) -> LuaResult<Function>
Compile the chunk and return it as a callable function handle.
Sourcepub async fn exec_async(self) -> LuaResult<()>
pub async fn exec_async(self) -> LuaResult<()>
Execute the chunk asynchronously and discard returned values.
Sourcepub fn eval<R: FromLua>(self) -> LuaResult<R>
pub fn eval<R: FromLua>(self) -> LuaResult<R>
Execute the chunk and convert the first return value.
Sourcepub async fn eval_async<R: FromLua>(self) -> LuaResult<R>
pub async fn eval_async<R: FromLua>(self) -> LuaResult<R>
Execute the chunk asynchronously and convert the first return value.
Sourcepub fn eval_multi<R: FromLuaMulti>(self) -> LuaResult<R>
pub fn eval_multi<R: FromLuaMulti>(self) -> LuaResult<R>
Execute the chunk and convert all returned values.
Sourcepub async fn eval_multi_async<R: FromLuaMulti>(self) -> LuaResult<R>
pub async fn eval_multi_async<R: FromLuaMulti>(self) -> LuaResult<R>
Execute the chunk asynchronously and convert all returned values.
Sourcepub fn call<A: IntoLua, R: FromLuaMulti>(self, args: A) -> LuaResult<R>
pub fn call<A: IntoLua, R: FromLuaMulti>(self, args: A) -> LuaResult<R>
Compile the chunk and call it with Rust arguments.
Sourcepub async fn call_async<A: IntoLua, R: FromLuaMulti>(
self,
args: A,
) -> LuaResult<R>
pub async fn call_async<A: IntoLua, R: FromLuaMulti>( self, args: A, ) -> LuaResult<R>
Compile the chunk and call it asynchronously with Rust arguments.
Sourcepub fn call1<A: IntoLua, R: FromLua>(self, args: A) -> LuaResult<R>
pub fn call1<A: IntoLua, R: FromLua>(self, args: A) -> LuaResult<R>
Compile the chunk and call it, converting only the first return value.
Sourcepub async fn call1_async<A: IntoLua, R: FromLua>(self, args: A) -> LuaResult<R>
pub async fn call1_async<A: IntoLua, R: FromLua>(self, args: A) -> LuaResult<R>
Compile the chunk and call it asynchronously, converting only the first return value.
Auto Trait Implementations§
impl<'lua> Freeze for Chunk<'lua>
impl<'lua> !RefUnwindSafe for Chunk<'lua>
impl<'lua> !Send for Chunk<'lua>
impl<'lua> !Sync for Chunk<'lua>
impl<'lua> Unpin for Chunk<'lua>
impl<'lua> UnsafeUnpin for Chunk<'lua>
impl<'lua> !UnwindSafe for Chunk<'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