pub struct TypedModuleBuilder {
pub doc: Option<Cow<'static, str>>,
pub nested_modules: BTreeMap<Cow<'static, str>, TypedModuleBuilder>,
pub fields: BTreeMap<Cow<'static, str>, Field>,
pub meta_fields: BTreeMap<Cow<'static, str>, Field>,
pub functions: BTreeMap<Cow<'static, str>, Func>,
pub methods: BTreeMap<Cow<'static, str>, Func>,
pub meta_functions: BTreeMap<Cow<'static, str>, Func>,
pub meta_methods: BTreeMap<Cow<'static, str>, Func>,
/* private fields */
}
Expand description
Builder that constructs type and documentation information for a module using the TypedModule
trait
Fields§
§doc: Option<Cow<'static, str>>
§nested_modules: BTreeMap<Cow<'static, str>, TypedModuleBuilder>
§fields: BTreeMap<Cow<'static, str>, Field>
§meta_fields: BTreeMap<Cow<'static, str>, Field>
§functions: BTreeMap<Cow<'static, str>, Func>
§methods: BTreeMap<Cow<'static, str>, Func>
§meta_functions: BTreeMap<Cow<'static, str>, Func>
§meta_methods: BTreeMap<Cow<'static, str>, Func>
Implementations§
Source§impl TypedModuleBuilder
impl TypedModuleBuilder
pub fn new<M: TypedModule>() -> Result<Self>
pub fn is_empty(&self) -> bool
pub fn is_meta_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for TypedModuleBuilder
impl Clone for TypedModuleBuilder
Source§fn clone(&self) -> TypedModuleBuilder
fn clone(&self) -> TypedModuleBuilder
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 TypedModuleBuilder
impl Debug for TypedModuleBuilder
Source§impl Default for TypedModuleBuilder
impl Default for TypedModuleBuilder
Source§fn default() -> TypedModuleBuilder
fn default() -> TypedModuleBuilder
Returns the “default value” for a type. Read more
Source§impl Ord for TypedModuleBuilder
impl Ord for TypedModuleBuilder
Source§fn cmp(&self, other: &TypedModuleBuilder) -> Ordering
fn cmp(&self, other: &TypedModuleBuilder) -> 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 TypedModuleBuilder
impl PartialEq for TypedModuleBuilder
Source§impl PartialOrd for TypedModuleBuilder
impl PartialOrd for TypedModuleBuilder
Source§impl<'lua> TypedModuleFields<'lua> for TypedModuleBuilder
impl<'lua> TypedModuleFields<'lua> for TypedModuleBuilder
Source§fn document<V: AsRef<str>>(&mut self, doc: V) -> &mut Self
fn document<V: AsRef<str>>(&mut self, doc: V) -> &mut Self
Queue a doc comment to be used with the nest
add
callSource§fn add_module<V>(&mut self, name: impl AsRef<str>) -> Result<()>where
V: TypedModule,
fn add_module<V>(&mut self, name: impl AsRef<str>) -> Result<()>where
V: TypedModule,
Typed variant of
add_module
only collecting the type informationSource§fn add_field<K, V>(&mut self, name: K, _value: V) -> Result<()>
fn add_field<K, V>(&mut self, name: K, _value: V) -> Result<()>
Typed variant of
add_field
only collecting the type informationSource§fn add_meta_field<K, V>(&mut self, name: K, _value: V) -> Result<()>
fn add_meta_field<K, V>(&mut self, name: K, _value: V) -> Result<()>
Typed variant of
add_meta_field
only collecting the type informationSource§impl<'lua> TypedModuleMethods<'lua> for TypedModuleBuilder
impl<'lua> TypedModuleMethods<'lua> for TypedModuleBuilder
Source§fn document<V: AsRef<str>>(&mut self, doc: V) -> &mut Self
fn document<V: AsRef<str>>(&mut self, doc: V) -> &mut Self
Queue a doc comment to be used with the nest
add
callSource§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<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 informationSource§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_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 Read moreSource§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<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 informationSource§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_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 Read moreSource§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<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 informationSource§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_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 Read moreSource§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<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 informationSource§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>),
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 Read moreimpl Eq for TypedModuleBuilder
impl StructuralPartialEq for TypedModuleBuilder
Auto Trait Implementations§
impl Freeze for TypedModuleBuilder
impl RefUnwindSafe for TypedModuleBuilder
impl Send for TypedModuleBuilder
impl Sync for TypedModuleBuilder
impl Unpin for TypedModuleBuilder
impl UnwindSafe for TypedModuleBuilder
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