Attribute Macro aliri_braid::braid

source ·
#[braid]
Expand description

Constructs a braid

Any attributes assigned to the the struct will be applied to both the owned and borrowed types, except for doc-comments, with will only be applied to the owned form.

Available options:

  • ref_name = "RefName"
    • Sets the name of the borrowed type
  • ref_doc = "Alternate doc comment"
    • Overrides the default doc comment for the borrowed type
  • ref_attr = "#[derive(...)]"
    • Provides an attribute to be placed only on the borrowed type
  • owned_attr = "#[derive(...)]"
    • Provides an attribute to be placed only on the owned type
  • either validator [ = "Type" ] or normalizer [ = "Type" ]
    • Indicates the type is validated or normalized. If not specified, it is assumed that the braid implements the relevant trait itself.
  • clone = "impl|omit" (default: impl)
    • Changes the automatic derivation of a Clone implementation on the owned type.
  • debug = "impl|owned|omit" (default impl)
    • Changes how automatic implementations of the Debug trait are provided. If owned, then the owned type will generate a Debug implementation that will just delegate to the borrowed implementation. If omit, then no implementations of Debug will be provided.
  • display = "impl|owned|omit" (default impl)
    • Changes how automatic implementations of the Display trait are provided. If owned, then the owned type will generate a Display implementation that will just delegate to the borrowed implementation. If omit, then no implementations of Display will be provided.
  • ord = "impl|owned|omit" (default impl)
    • Changes how automatic implementations of the PartialOrd and Ord traits are provided. If owned, then the owned type will generate implementations that will just delegate to the borrowed implementations. If omit, then no implementations will be provided.
  • serde = "impl|omit" (default omit)
    • Adds serialize and deserialize implementations
  • no_expose
    • Functions that expose the internal field type will not be exposed publicly.
  • no_std
    • Generates no_std-compatible braid (still requires alloc)