pub struct TypedClassBuilder {
pub type_doc: Option<Cow<'static, str>>,
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>, Func>,
pub meta_methods: BTreeMap<Cow<'static, str>, Func>,
pub functions: BTreeMap<Cow<'static, str>, Func>,
pub meta_functions: BTreeMap<Cow<'static, str>, Func>,
/* private fields */
}
Expand description
Type information for a lua class
. This happens to be a TypedUserData
Fields§
§type_doc: Option<Cow<'static, str>>
§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>, Func>
§meta_methods: BTreeMap<Cow<'static, str>, Func>
§functions: BTreeMap<Cow<'static, str>, Func>
§meta_functions: BTreeMap<Cow<'static, str>, Func>
Implementations§
Source§impl TypedClassBuilder
impl TypedClassBuilder
pub fn new<T: TypedUserData>() -> Self
Trait Implementations§
Source§impl Clone for TypedClassBuilder
impl Clone for TypedClassBuilder
Source§fn clone(&self) -> TypedClassBuilder
fn clone(&self) -> TypedClassBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TypedClassBuilder
impl Debug for TypedClassBuilder
Source§impl Default for TypedClassBuilder
impl Default for TypedClassBuilder
Source§fn default() -> TypedClassBuilder
fn default() -> TypedClassBuilder
Returns the “default value” for a type. Read more
Source§impl Ord for TypedClassBuilder
impl Ord for TypedClassBuilder
Source§fn cmp(&self, other: &TypedClassBuilder) -> Ordering
fn cmp(&self, other: &TypedClassBuilder) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TypedClassBuilder
impl PartialEq for TypedClassBuilder
Source§impl PartialOrd for TypedClassBuilder
impl PartialOrd for TypedClassBuilder
Source§impl<'lua, T: TypedUserData> TypedDataFields<'lua, T> for TypedClassBuilder
impl<'lua, T: TypedUserData> TypedDataFields<'lua, T> for TypedClassBuilder
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<R, F>(&mut self, meta: MetaMethod, _: F)
fn add_meta_field<R, F>(&mut self, meta: MetaMethod, _: F)
Typed version of add_meta_field
Source§impl<'lua, T: TypedUserData> TypedDataMethods<'lua, T> for TypedClassBuilder
impl<'lua, T: TypedUserData> TypedDataMethods<'lua, T> for TypedClassBuilder
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_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_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 Read more
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_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_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) Read more
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_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_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 Read more
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_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_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 Read more
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_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_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 Read more
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,
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,
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 Read more
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_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_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 Read more
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_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_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 Read more
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_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_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 Read more
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_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_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 Read more
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
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>),
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
impl Eq for TypedClassBuilder
impl StructuralPartialEq for TypedClassBuilder
Auto Trait Implementations§
impl Freeze for TypedClassBuilder
impl RefUnwindSafe for TypedClassBuilder
impl Send for TypedClassBuilder
impl Sync for TypedClassBuilder
impl Unpin for TypedClassBuilder
impl UnwindSafe for TypedClassBuilder
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