Struct TypedModuleBuilder

Source
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

Source

pub fn new<M: TypedModule>() -> Result<Self>

Source

pub fn is_empty(&self) -> bool

Source

pub fn is_meta_empty(&self) -> bool

Trait Implementations§

Source§

impl Clone for TypedModuleBuilder

Source§

fn clone(&self) -> TypedModuleBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TypedModuleBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TypedModuleBuilder

Source§

fn default() -> TypedModuleBuilder

Returns the “default value” for a type. Read more
Source§

impl Ord for TypedModuleBuilder

Source§

fn cmp(&self, other: &TypedModuleBuilder) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for TypedModuleBuilder

Source§

fn eq(&self, other: &TypedModuleBuilder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for TypedModuleBuilder

Source§

fn partial_cmp(&self, other: &TypedModuleBuilder) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'lua> TypedModuleFields<'lua> for TypedModuleBuilder

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_module<V>(&mut self, name: impl AsRef<str>) -> Result<()>
where V: TypedModule,

Typed variant of add_module only collecting the type information
Source§

fn add_field<K, V>(&mut self, name: K, _value: V) -> Result<()>
where K: AsRef<str>, V: IntoLua<'lua> + Typed,

Typed variant of add_field only collecting the type information
Source§

fn add_meta_field<K, V>(&mut self, name: K, _value: V) -> Result<()>
where K: AsRef<str>, V: IntoLua<'lua> + Typed,

Typed variant of add_meta_field only collecting the type information
Source§

impl<'lua> TypedModuleMethods<'lua> for TypedModuleBuilder

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 Read more
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 Read more
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 Read more
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 Read more
Source§

impl Eq for TypedModuleBuilder

Source§

impl StructuralPartialEq for TypedModuleBuilder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> MaybeSend for T
where T: Send,