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" ]
ornormalizer [ = "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.
- Changes the automatic derivation of a
debug = "impl|owned|omit"
(defaultimpl
)- Changes how automatic implementations of the
Debug
trait are provided. Ifowned
, then the owned type will generate aDebug
implementation that will just delegate to the borrowed implementation. Ifomit
, then no implementations ofDebug
will be provided.
- Changes how automatic implementations of the
display = "impl|owned|omit"
(defaultimpl
)- Changes how automatic implementations of the
Display
trait are provided. Ifowned
, then the owned type will generate aDisplay
implementation that will just delegate to the borrowed implementation. Ifomit
, then no implementations ofDisplay
will be provided.
- Changes how automatic implementations of the
ord = "impl|owned|omit"
(defaultimpl
)- Changes how automatic implementations of the
PartialOrd
andOrd
traits are provided. Ifowned
, then the owned type will generate implementations that will just delegate to the borrowed implementations. Ifomit
, then no implementations will be provided.
- Changes how automatic implementations of the
serde = "impl|omit"
(defaultomit
)- 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 requiresalloc
)
- Generates