Trait TypedUserData

Source
pub trait TypedUserData: Sized {
    // Provided methods
    fn add_documentation<F: TypedDataDocumentation<Self>>(docs: &mut F) { ... }
    fn add_methods<'lua, T: TypedDataMethods<'lua, Self>>(methods: &mut T) { ... }
    fn add_fields<'lua, F: TypedDataFields<'lua, Self>>(fields: &mut F) { ... }
}
Expand description

Typed variant of [UserData]

Provided Methods§

Source

fn add_documentation<F: TypedDataDocumentation<Self>>(docs: &mut F)

Add documentation to the type itself

Source

fn add_methods<'lua, T: TypedDataMethods<'lua, Self>>(methods: &mut T)

same as [UserData::add_methods]. Refer to its documentation on how to use it.

only difference is that it takes a TypedDataMethods, which is the typed version of [UserDataMethods]

Source

fn add_fields<'lua, F: TypedDataFields<'lua, Self>>(fields: &mut F)

same as [UserData::add_fields]. Refer to its documentation on how to use it.

only difference is that it takes a TypedDataFields, which is the typed version of [UserDataFields]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§