Expand description
§Module :: derive_tools_meta
Collection of derives which extend STD. Its meta module.
Don’t use it directly. Instead use derive_tools which is front-end for derive_tools_meta.
Attribute Macros§
- phantom
- Provides an automatic
PhantomDatafield for a struct based on its generic types.
Derive Macros§
- AsMut
- Derive macro to implement AsMut when-ever it’s possible to do automatically.
- AsRef
- Derive macro to implement
AsRefwhen-ever it’s possible to do automatically. - Deref
- Derive macro to implement Deref when-ever it’s possible to do automatically.
- Deref
Mut - Derive macro to implement Deref when-ever it’s possible to do automatically.
- From
- Provides an automatic
Fromimplementation for struct wrapping a single value. - Index
- Provides an automatic Index trait implementation when-ever it’s possible.
- Index
Mut - Provides an automatic IndexMut trait implementation when-ever it’s possible.
- Inner
From - Derive macro to implement From converting outer type into inner when-ever it’s possible to do automatically.
- New
- Provides an automatic
newimplementation for struct wrapping a single value. - Not
- Provides an automatic Not trait implementation for struct.
- Variadic
From - The
derive_variadic_frommacro is designed to provide a way to implement theFrom-like traits for structs with a variable number of fields, allowing them to be constructed from tuples of different lengths or from individual arguments. This functionality is particularly useful for creating flexible constructors that enable different methods of instantiation for a struct. By automating the implementation of traits, this macro reduces boilerplate code and enhances code readability and maintainability.