Crate former_meta

source ·
Expand description

§Module :: former_meta

experimental rust-status docs.rs discord

Former - a variation of builder pattern. Implementation of its derive macro. Should not be used independently, instead use module::former which relies on the module.

Not intended to be used without runtime. This module and runtime is aggregate in module::former is here.

§To add to your project

cargo add former_meta

Derive Macros§

  • Derives the ComponentAssign trait for struct fields, allowing each field to be set with a value that can be converted into the field’s type.
  • Macro to implement From for each component (field) of a structure. This macro simplifies the creation of From trait implementations for struct fields, enabling easy conversion from a struct reference to its field types.
  • Derives the ComponentsAssign trait for a struct, enabling components_assign which set all fields at once.
  • Derive macro for generating a Former struct, applying a Builder Pattern to the annotated struct.
  • A procedural macro to automatically derive the From<T> trait implementation for a struct, enabling instances of one type to be converted from instances of another type.