Trait mlua::TableExt [−][src]
pub trait TableExt<'lua> { fn call_method<K, A, R>(&self, key: K, args: A) -> Result<R>
where
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>; fn call_function<K, A, R>(&self, key: K, args: A) -> Result<R>
where
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>; fn call_async_method<'fut, K, A, R>(
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>>
where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut; fn call_async_function<'fut, K, A, R>(
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>>
where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut; }
Expand description
An extension trait for Table
s that provides a variety of convenient functionality.
Required methods
fn call_method<K, A, R>(&self, key: K, args: A) -> Result<R> where
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>,
[src]
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>,
Expand description
Gets the function associated to key
from the table and executes it,
passing the table itself along with args
as function arguments.
This is a shortcut for
table.get::<_, Function>(key)?.call((table.clone(), arg1, ..., argN))
This might invoke the __index
metamethod.
fn call_function<K, A, R>(&self, key: K, args: A) -> Result<R> where
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>,
[src]
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>,
Expand description
Gets the function associated to key
from the table and executes it,
passing args
as function arguments.
This is a shortcut for
table.get::<_, Function>(key)?.call(args)
This might invoke the __index
metamethod.
fn call_async_method<'fut, K, A, R>(
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>> where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut,
[src]
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>> where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut,
async
only.Expand description
Gets the function associated to key
from the table and asynchronously executes it,
passing the table itself along with args
as function arguments and returning Future.
Requires feature = "async"
This might invoke the __index
metamethod.
fn call_async_function<'fut, K, A, R>(
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>> where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut,
[src]
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>> where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut,
async
only.Expand description
Gets the function associated to key
from the table and asynchronously executes it,
passing args
as function arguments and returning Future.
Requires feature = "async"
This might invoke the __index
metamethod.
Implementors
impl<'lua> TableExt<'lua> for Table<'lua>
[src]
impl<'lua> TableExt<'lua> for Table<'lua>
[src]fn call_method<K, A, R>(&self, key: K, args: A) -> Result<R> where
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>,
[src]
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>,
fn call_function<K, A, R>(&self, key: K, args: A) -> Result<R> where
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>,
[src]
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua>,
fn call_async_method<'fut, K, A, R>(
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>> where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut,
[src]
fn call_async_method<'fut, K, A, R>(
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>> where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut,
[src]async
only.fn call_async_function<'fut, K, A, R>(
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>> where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut,
[src]
fn call_async_function<'fut, K, A, R>(
&self,
key: K,
args: A
) -> LocalBoxFuture<'fut, Result<R>> where
'lua: 'fut,
K: ToLua<'lua>,
A: ToLuaMulti<'lua>,
R: FromLuaMulti<'lua> + 'fut,
[src]async
only.