Struct mlua_extras::typed::Class
source · pub struct Class {
pub type_doc: Vec<String>,
pub fields: BTreeMap<Cow<'static, str>, Field>,
pub static_fields: BTreeMap<Cow<'static, str>, Field>,
pub meta_fields: BTreeMap<Cow<'static, str>, Field>,
pub methods: BTreeMap<Cow<'static, str>, Fun>,
pub meta_methods: BTreeMap<Cow<'static, str>, Fun>,
pub functions: BTreeMap<Cow<'static, str>, Fun>,
pub meta_functions: BTreeMap<Cow<'static, str>, Fun>,
/* private fields */
}
Expand description
Type information for a lua class
. This happens to be a TypedUserData
Fields§
§type_doc: Vec<String>
§fields: BTreeMap<Cow<'static, str>, Field>
§static_fields: BTreeMap<Cow<'static, str>, Field>
§meta_fields: BTreeMap<Cow<'static, str>, Field>
§methods: BTreeMap<Cow<'static, str>, Fun>
§meta_methods: BTreeMap<Cow<'static, str>, Fun>
§functions: BTreeMap<Cow<'static, str>, Fun>
§meta_functions: BTreeMap<Cow<'static, str>, Fun>
Implementations§
Trait Implementations§
source§impl Ord for Class
impl Ord for Class
source§impl PartialOrd for Class
impl PartialOrd for Class
source§impl<T: TypedUserData> TypedDataDocumentation<T> for Class
impl<T: TypedUserData> TypedDataDocumentation<T> for Class
source§impl<'lua, T: TypedUserData> TypedDataFields<'lua, T> for Class
impl<'lua, T: TypedUserData> TypedDataFields<'lua, T> for Class
source§fn document(&mut self, doc: &str) -> &mut Self
fn document(&mut self, doc: &str) -> &mut Self
Adds documentation to the next field that gets added
source§fn add_field_function_set<S, A, F>(&mut self, name: &S, _: F)
fn add_field_function_set<S, A, F>(&mut self, name: &S, _: F)
Typed version of add_field_function_set
source§fn add_field_function_get<S, R, F>(&mut self, name: &S, _: F)
fn add_field_function_get<S, R, F>(&mut self, name: &S, _: F)
Typed version of add_field_function_get
source§fn add_field_function_get_set<S, R, A, GET, SET>(
&mut self,
name: &S,
_: GET,
_: SET,
)
fn add_field_function_get_set<S, R, A, GET, SET>( &mut self, name: &S, _: GET, _: SET, )
Typed version of add_field_function_get and add_field_function_set combined
source§fn add_field_method_set<S, A, M>(&mut self, name: &S, _: M)
fn add_field_method_set<S, A, M>(&mut self, name: &S, _: M)
Typed version of dd_field_method_set
source§fn add_field_method_get<S, R, M>(&mut self, name: &S, _: M)
fn add_field_method_get<S, R, M>(&mut self, name: &S, _: M)
Typed version of add_field_method_get
source§fn add_field_method_get_set<S, R, A, GET, SET>(
&mut self,
name: &S,
_: GET,
_: SET,
)
fn add_field_method_get_set<S, R, A, GET, SET>( &mut self, name: &S, _: GET, _: SET, )
Typed version of add_field_method_get and add_field_method_set combined
source§fn add_meta_field_with<R, F>(&mut self, meta: MetaMethod, _: F)
fn add_meta_field_with<R, F>(&mut self, meta: MetaMethod, _: F)
Typed version of add_meta_field_with
source§impl<'lua, T: TypedUserData> TypedDataMethods<'lua, T> for Class
impl<'lua, T: TypedUserData> TypedDataMethods<'lua, T> for Class
source§fn document(&mut self, documentation: &str) -> &mut Self
fn document(&mut self, documentation: &str) -> &mut Self
Adds documentation to the next method/function that gets added
source§fn add_method<S, A, R, M>(&mut self, name: &S, _: 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<S, A, R, M>(&mut self, name: &S, _: 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_function<S, A, R, F>(&mut self, name: &S, _: 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<S, A, R, F>(&mut self, name: &S, _: 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_method_mut<S, A, R, M>(&mut self, name: &S, _: 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<S, A, R, M>(&mut self, name: &S, _: 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_meta_method<A, R, M>(&mut self, meta: MetaMethod, _: M)where
A: FromLuaMulti<'lua> + TypedMultiValue,
R: IntoLuaMulti<'lua> + TypedMultiValue,
M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>,
fn add_meta_method<A, R, M>(&mut self, meta: MetaMethod, _: 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_async_method<'s, S: ?Sized + AsRef<str>, A, R, M, MR>(
&mut self,
name: &S,
_: 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<'s, S: ?Sized + AsRef<str>, A, R, M, MR>(
&mut self,
name: &S,
_: 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_function_mut<S, A, R, F>(&mut self, name: &S, _: 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<S, A, R, F>(&mut self, name: &S, _: 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_meta_function<A, R, F>(&mut self, meta: MetaMethod, _: F)where
A: FromLuaMulti<'lua> + TypedMultiValue,
R: IntoLuaMulti<'lua> + TypedMultiValue,
F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>,
fn add_meta_function<A, R, F>(&mut self, meta: MetaMethod, _: 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_async_function<S, A, R, F, FR>(&mut self, name: &S, _: 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<S, A, R, F, FR>(&mut self, name: &S, _: 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_meta_method_mut<A, R, M>(&mut self, meta: MetaMethod, _: 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<A, R, M>(&mut self, meta: MetaMethod, _: 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_function_mut<A, R, F>(&mut self, meta: MetaMethod, _: F)where
A: FromLuaMulti<'lua> + TypedMultiValue,
R: IntoLuaMulti<'lua> + TypedMultiValue,
F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>,
fn add_meta_function_mut<A, R, F>(&mut self, meta: MetaMethod, _: 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
impl Eq for Class
impl StructuralPartialEq for Class
Auto Trait Implementations§
impl Freeze for Class
impl RefUnwindSafe for Class
impl Send for Class
impl Sync for Class
impl Unpin for Class
impl UnwindSafe for Class
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)