Skip to main content

Crate rustango_macros

Crate rustango_macros 

Source
Expand description

Proc-macros for rustango.

v0.1 ships #[derive(Model)], which emits:

  • a Model impl carrying a static ModelSchema,
  • an inventory::submit! so the model is discoverable from the registry,
  • an inherent objects() returning a QuerySet<Self>,
  • a sqlx::FromRow impl so query results decode into the struct.

Macros§

embed_migrations
Bake every *.json migration file in a directory into the binary at compile time. Returns a &'static [(&'static str, &'static str)] of (name, json_content) pairs, lex-sorted by file stem.

Derive Macros§

Form
Derive rustango::forms::FormStruct (slice 8.4B). Generates a parse(&HashMap<String, String>) -> Result<Self, FormError> impl that walks every named field and:
Model
Derive a Model impl. See crate docs for the supported attributes.