Crate derive_tools_meta

Source
Expand description

§Module :: derive_tools_meta

experimental rust-status docs.rs discord

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 PhantomData field 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 AsRef when-ever it’s possible to do automatically.
Deref
Derive macro to implement Deref when-ever it’s possible to do automatically.
DerefMut
Derive macro to implement Deref when-ever it’s possible to do automatically.
From
Provides an automatic From implementation for struct wrapping a single value.
Index
Provides an automatic Index trait implementation when-ever it’s possible.
IndexMut
Provides an automatic IndexMut trait implementation when-ever it’s possible.
InnerFrom
Derive macro to implement From converting outer type into inner when-ever it’s possible to do automatically.
New
Provides an automatic new implementation for struct wrapping a single value.
Not
Provides an automatic Not trait implementation for struct.
VariadicFrom
The derive_variadic_from macro is designed to provide a way to implement the From-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.