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§

  • Provides an automatic PhantomData field for a struct based on its generic types.

Derive Macros§

  • Derive macro to implement AsMut when-ever it’s possible to do automatically.
  • Derive macro to implement AsRef when-ever it’s possible to do automatically.
  • Derive macro to implement Deref when-ever it’s possible to do automatically.
  • Derive macro to implement Deref when-ever it’s possible to do automatically.
  • Provides an automatic From implementation for struct wrapping a single value.
  • Provides an automatic Index trait implementation when-ever it’s possible.
  • Provides an automatic IndexMut trait implementation when-ever it’s possible.
  • Derive macro to implement From converting outer type into inner when-ever it’s possible to do automatically.
  • Provides an automatic new implementation for struct wrapping a single value.
  • Provides an automatic Not trait implementation for struct.
  • 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.