Trait TypedModuleMethods

Source
pub trait TypedModuleMethods<'lua> {
    // Required methods
    fn document<V: AsRef<str>>(&mut self, doc: V) -> &mut Self;
    fn add_function<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>
       where K: AsRef<str>,
             F: Fn(&Lua, A) -> Result<R> + MaybeSend + 'static,
             A: FromLuaMulti<'lua> + TypedMultiValue,
             R: IntoLuaMulti<'lua> + TypedMultiValue;
    fn add_function_with<K, F, A, R, G>(
        &mut self,
        name: K,
        function: F,
        generator: G,
    ) -> Result<()>
       where K: AsRef<str>,
             F: Fn(&Lua, A) -> Result<R> + MaybeSend + 'static,
             A: FromLuaMulti<'lua> + TypedMultiValue,
             R: IntoLuaMulti<'lua> + TypedMultiValue,
             G: Fn(&mut FunctionBuilder<A, R>);
    fn add_meta_function<K, F, A, R>(
        &mut self,
        name: K,
        function: F,
    ) -> Result<()>
       where K: AsRef<str>,
             F: Fn(&Lua, A) -> Result<R> + MaybeSend + 'static,
             A: FromLuaMulti<'lua> + TypedMultiValue,
             R: IntoLuaMulti<'lua> + TypedMultiValue;
    fn add_meta_function_with<K, F, A, R, G>(
        &mut self,
        name: K,
        function: F,
        generator: G,
    ) -> Result<()>
       where K: AsRef<str>,
             F: Fn(&Lua, A) -> Result<R> + MaybeSend + 'static,
             A: FromLuaMulti<'lua> + TypedMultiValue,
             R: IntoLuaMulti<'lua> + TypedMultiValue,
             G: Fn(&mut FunctionBuilder<A, R>);
    fn add_method<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>
       where K: AsRef<str>,
             F: Fn(&Lua, Table<'_>, A) -> Result<R> + MaybeSend + 'static,
             A: FromLuaMulti<'lua> + TypedMultiValue,
             R: IntoLuaMulti<'lua> + TypedMultiValue;
    fn add_method_with<K, F, A, R, G>(
        &mut self,
        name: K,
        function: F,
        generator: G,
    ) -> Result<()>
       where K: AsRef<str>,
             F: Fn(&Lua, Table<'_>, A) -> Result<R> + MaybeSend + 'static,
             A: FromLuaMulti<'lua> + TypedMultiValue,
             R: IntoLuaMulti<'lua> + TypedMultiValue,
             G: Fn(&mut FunctionBuilder<A, R>);
    fn add_meta_method<K, F, A, R>(
        &mut self,
        name: K,
        function: F,
    ) -> Result<()>
       where K: AsRef<str>,
             F: Fn(&Lua, Table<'_>, A) -> Result<R> + MaybeSend + 'static,
             A: FromLuaMulti<'lua> + TypedMultiValue,
             R: IntoLuaMulti<'lua> + TypedMultiValue;
    fn add_meta_method_with<K, F, A, R, G>(
        &mut self,
        name: K,
        function: F,
        generator: G,
    ) -> Result<()>
       where K: AsRef<str>,
             F: Fn(&Lua, Table<'_>, A) -> Result<R> + MaybeSend + 'static,
             A: FromLuaMulti<'lua> + TypedMultiValue,
             R: IntoLuaMulti<'lua> + TypedMultiValue,
             G: Fn(&mut FunctionBuilder<A, R>);
}
Expand description

Typed variant of ModuleMethods

Required Methods§

Source

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

Queue a doc comment to be used with the nest add call

Source

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

Typed variant of add_function only collecting the type information

Source

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

Typed variant of add_function only collecting the type information

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

Source

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

Typed variant of add_meta_function only collecting the type information

Source

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

Typed variant of add_meta_function only collecting the type information

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

Source

fn add_method<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>
where K: AsRef<str>, F: Fn(&Lua, Table<'_>, A) -> Result<R> + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue,

Typed variant of add_method only collecting the type information

Source

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

Typed variant of add_method only collecting the type information

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

Source

fn add_meta_method<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>
where K: AsRef<str>, F: Fn(&Lua, Table<'_>, A) -> Result<R> + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue,

Typed variant of add_meta_method only collecting the type information

Source

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

Typed variant of add_meta_method only collecting the type information

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

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§