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§
Sourcefn add_documentation<F: TypedDataDocumentation<Self>>(docs: &mut F)
fn add_documentation<F: TypedDataDocumentation<Self>>(docs: &mut F)
Add documentation to the type itself
Sourcefn add_methods<'lua, T: TypedDataMethods<'lua, Self>>(methods: &mut T)
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]
Sourcefn add_fields<'lua, F: TypedDataFields<'lua, Self>>(fields: &mut F)
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.