Expand description
Macros for butane
Macros§
Attribute Macros§
- butane_
type - Attribute macro which marks a type as being available to butane for use in models.
- dataresult
- Attribute macro which generates an implementation of
DataResult. Continuing with our blog post example from model, we could create aDataResultwith only some of the fields fromPost(to avoid fetching all of them in a query). - model
- Attribute macro which marks a struct as being a data model and
generates an implementation of
DataObject. This macro will also write information to disk at compile time necessary to generate migrations
Derive Macros§
- Field
Type - Derive macro for
FieldType. Produces a String field for simple enums, otherwise uses a JSON field if json feature is enabled. E.g. - Primary
KeyType - Derive macro for marker trait
PrimaryKeyType. E.g.