Trait tealr::mlu::TealDataFields
source · pub trait TealDataFields<'lua, T: TealData> {
// Required methods
fn document(&mut self, documentation: &str);
fn add_field_method_get<S, R, M>(&mut self, name: &S, method: M)
where S: AsRef<str> + ?Sized,
R: IntoLua<'lua> + ToTypename,
M: 'static + MaybeSend + Fn(&'lua Lua, &T) -> Result<R>;
fn add_field_method_set<S, A, M>(&mut self, name: &S, method: M)
where S: AsRef<str> + ?Sized,
A: FromLua<'lua> + ToTypename,
M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<()>;
fn add_field_function_get<S, R, F>(&mut self, name: &S, function: F)
where S: AsRef<str> + ?Sized,
R: IntoLua<'lua> + ToTypename,
F: 'static + MaybeSend + Fn(&'lua Lua, AnyUserData<'lua>) -> Result<R>;
fn add_field_function_set<S, A, F>(&mut self, name: &S, function: F)
where S: AsRef<str> + ?Sized,
A: FromLua<'lua> + ToTypename,
F: 'static + MaybeSend + FnMut(&'lua Lua, AnyUserData<'lua>, A) -> Result<()>;
fn add_meta_field_with<R, F>(&mut self, meta: MetaMethod, f: F)
where F: 'static + MaybeSend + Fn(&'lua Lua) -> Result<R>,
R: IntoLua<'lua> + ToTypename;
}
Expand description
The teal version of UserDataFields
The meaning of every method is the same, and so is its use. Look at mlua for documentation
The only 2 differences are that TealDataFields has an extra type bound on R
.
These are to get the type names when generating the .d.tl
file.
Required Methods§
sourcefn document(&mut self, documentation: &str)
fn document(&mut self, documentation: &str)
Adds documentation to the next field that gets added
sourcefn add_field_method_get<S, R, M>(&mut self, name: &S, method: M)
fn add_field_method_get<S, R, M>(&mut self, name: &S, method: M)
the teal version of UserDataFields
sourcefn add_field_method_set<S, A, M>(&mut self, name: &S, method: M)
fn add_field_method_set<S, A, M>(&mut self, name: &S, method: M)
the teal version of UserDataFields
sourcefn add_field_function_get<S, R, F>(&mut self, name: &S, function: F)where
S: AsRef<str> + ?Sized,
R: IntoLua<'lua> + ToTypename,
F: 'static + MaybeSend + Fn(&'lua Lua, AnyUserData<'lua>) -> Result<R>,
fn add_field_function_get<S, R, F>(&mut self, name: &S, function: F)where
S: AsRef<str> + ?Sized,
R: IntoLua<'lua> + ToTypename,
F: 'static + MaybeSend + Fn(&'lua Lua, AnyUserData<'lua>) -> Result<R>,
the teal version of UserDataFields
sourcefn add_field_function_set<S, A, F>(&mut self, name: &S, function: F)
fn add_field_function_set<S, A, F>(&mut self, name: &S, function: F)
the teal version of UserDataFields
sourcefn add_meta_field_with<R, F>(&mut self, meta: MetaMethod, f: F)
fn add_meta_field_with<R, F>(&mut self, meta: MetaMethod, f: F)
the teal version of UserDataFields
Object Safety§
This trait is not object safe.