Trait TypedDataMethods

Source
pub trait TypedDataMethods<'lua, T> {
Show 23 methods // Required methods fn add_method<S, A, R, M>(&mut self, name: &S, method: M) where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>; fn add_method_with<S, A, R, M, G>( &mut self, name: &S, method: M, generator: G, ) where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>); fn add_method_mut<S, A, R, M>(&mut self, name: &S, method: M) where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>; fn add_method_mut_with<S, A, R, M, G>( &mut self, name: &S, method: M, generator: G, ) where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>); fn add_async_method<'s, S: ?Sized + AsRef<str>, A, R, M, MR>( &mut self, name: &S, method: M, ) where T: 'static, M: Fn(&'lua Lua, &'s T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, 'lua: 's; fn add_async_method_with<'s, S: ?Sized + AsRef<str>, A, R, M, MR, G>( &mut self, name: &S, method: M, generator: G, ) where T: 'static, M: Fn(&'lua Lua, &'s T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, G: Fn(&mut FunctionBuilder<A, R>), 'lua: 's; fn add_async_method_mut<'s, S: ?Sized + AsRef<str>, A, R, M, MR>( &mut self, name: &S, method: M, ) where T: 'static, M: Fn(&'lua Lua, &'s mut T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, 'lua: 's; fn add_async_method_mut_with<'s, S: ?Sized + AsRef<str>, A, R, M, MR, G>( &mut self, name: &S, method: M, generator: G, ) where T: 'static, M: Fn(&'lua Lua, &'s mut T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, G: Fn(&mut FunctionBuilder<A, R>), 'lua: 's; fn add_function<S, A, R, F>(&mut self, name: &S, function: F) where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>; fn add_function_with<S, A, R, F, G>( &mut self, name: &S, function: F, generator: G, ) where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>); fn add_function_mut<S, A, R, F>(&mut self, name: &S, function: F) where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>; fn add_function_mut_with<S, A, R, F, G>( &mut self, name: &S, function: F, generator: G, ) where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>); fn add_async_function<S, A, R, F, FR>(&mut self, name: &S, function: F) where S: AsRef<str> + ?Sized, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> FR, FR: 'lua + Future<Output = Result<R>>; fn add_async_function_with<S, A, R, F, FR, G>( &mut self, name: &S, function: F, generator: G, ) where S: AsRef<str> + ?Sized, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> FR, FR: 'lua + Future<Output = Result<R>>, G: Fn(&mut FunctionBuilder<A, R>); fn add_meta_method<A, R, M>(&mut self, meta: MetaMethod, method: M) where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>; fn add_meta_method_with<A, R, M, G>( &mut self, meta: MetaMethod, method: M, generator: G, ) where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>); fn add_meta_method_mut<A, R, M>(&mut self, meta: MetaMethod, method: M) where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>; fn add_meta_method_mut_with<A, R, M, G>( &mut self, meta: MetaMethod, method: M, generator: G, ) where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>); fn add_meta_function<A, R, F>(&mut self, meta: MetaMethod, function: F) where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>; fn add_meta_function_with<A, R, F, G>( &mut self, meta: MetaMethod, function: F, generator: G, ) where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>); fn add_meta_function_mut<A, R, F>(&mut self, meta: MetaMethod, function: F) where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>; fn add_meta_function_mut_with<A, R, F, G>( &mut self, meta: MetaMethod, function: F, generator: G, ) where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>); fn document(&mut self, doc: &str) -> &mut Self;
}
Expand description

Typed variant of [UserDataFields]

Required Methods§

Source

fn add_method<S, A, R, M>(&mut self, name: &S, method: M)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>,

Exposes a method to lua

Source

fn add_method_with<S, A, R, M, G>(&mut self, name: &S, method: M, generator: G)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a method to lua

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_method_mut<S, A, R, M>(&mut self, name: &S, method: M)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>,

Exposes a method to lua that has a mutable reference to Self

Source

fn add_method_mut_with<S, A, R, M, G>( &mut self, name: &S, method: M, generator: G, )
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a method to lua that has a mutable reference to Self

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_async_method<'s, S: ?Sized + AsRef<str>, A, R, M, MR>( &mut self, name: &S, method: M, )
where T: 'static, M: Fn(&'lua Lua, &'s T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, 'lua: 's,

exposes an async method to lua

Source

fn add_async_method_with<'s, S: ?Sized + AsRef<str>, A, R, M, MR, G>( &mut self, name: &S, method: M, generator: G, )
where T: 'static, M: Fn(&'lua Lua, &'s T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, G: Fn(&mut FunctionBuilder<A, R>), 'lua: 's,

exposes an async method to lua

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_async_method_mut<'s, S: ?Sized + AsRef<str>, A, R, M, MR>( &mut self, name: &S, method: M, )
where T: 'static, M: Fn(&'lua Lua, &'s mut T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, 'lua: 's,

exposes an async method to lua

Source

fn add_async_method_mut_with<'s, S: ?Sized + AsRef<str>, A, R, M, MR, G>( &mut self, name: &S, method: M, generator: G, )
where T: 'static, M: Fn(&'lua Lua, &'s mut T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, G: Fn(&mut FunctionBuilder<A, R>), 'lua: 's,

exposes an async method to lua

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_function<S, A, R, F>(&mut self, name: &S, function: F)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>,

Exposes a function to lua (its a method that does not take Self)

Source

fn add_function_with<S, A, R, F, G>( &mut self, name: &S, function: F, generator: G, )
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a function to lua (its a method that does not take Self)

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_function_mut<S, A, R, F>(&mut self, name: &S, function: F)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>,

Exposes a mutable function to lua

Source

fn add_function_mut_with<S, A, R, F, G>( &mut self, name: &S, function: F, generator: G, )
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a mutable function to lua

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_async_function<S, A, R, F, FR>(&mut self, name: &S, function: F)
where S: AsRef<str> + ?Sized, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> FR, FR: 'lua + Future<Output = Result<R>>,

exposes an async function to lua

Source

fn add_async_function_with<S, A, R, F, FR, G>( &mut self, name: &S, function: F, generator: G, )
where S: AsRef<str> + ?Sized, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> FR, FR: 'lua + Future<Output = Result<R>>, G: Fn(&mut FunctionBuilder<A, R>),

exposes an async function to lua

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_meta_method<A, R, M>(&mut self, meta: MetaMethod, method: M)
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>,

Exposes a meta method to lua http://lua-users.org/wiki/MetatableEvents

Source

fn add_meta_method_with<A, R, M, G>( &mut self, meta: MetaMethod, method: M, generator: G, )
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a meta method to lua http://lua-users.org/wiki/MetatableEvents

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_meta_method_mut<A, R, M>(&mut self, meta: MetaMethod, method: M)
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>,

Exposes a meta and mutable method to lua http://lua-users.org/wiki/MetatableEvents

Source

fn add_meta_method_mut_with<A, R, M, G>( &mut self, meta: MetaMethod, method: M, generator: G, )
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a meta and mutable method to lua http://lua-users.org/wiki/MetatableEvents

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_meta_function<A, R, F>(&mut self, meta: MetaMethod, function: F)
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>,

Exposes a meta function to lua http://lua-users.org/wiki/MetatableEvents

Source

fn add_meta_function_with<A, R, F, G>( &mut self, meta: MetaMethod, function: F, generator: G, )
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a meta function to lua http://lua-users.org/wiki/MetatableEvents

Pass an additional callback that allows for param names, param doc comments, and return doc comments to be specified.

Source

fn add_meta_function_mut<A, R, F>(&mut self, meta: MetaMethod, function: F)
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>,

Exposes a meta and mutable function to lua http://lua-users.org/wiki/MetatableEvents

Source

fn add_meta_function_mut_with<A, R, F, G>( &mut self, meta: MetaMethod, function: F, generator: G, )
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a meta and mutable function to lua http://lua-users.org/wiki/MetatableEvents

Source

fn document(&mut self, doc: &str) -> &mut Self

Adds documentation to the next method/function that gets added

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'lua, 'ctx, T: UserData, U: UserDataMethods<'lua, T>> TypedDataMethods<'lua, T> for WrappedBuilder<'ctx, U>

Source§

impl<'lua, T: TypedUserData> TypedDataMethods<'lua, T> for TypedClassBuilder