Expand description
Proc-macros for rustango.
v0.1 ships #[derive(Model)], which emits:
- a
Modelimpl carrying a staticModelSchema, - an
inventory::submit!so the model is discoverable from the registry, - an inherent
objects()returning aQuerySet<Self>, - a
sqlx::FromRowimpl so query results decode into the struct.
Macros§
- embed_
migrations - Bake every
*.jsonmigration 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.
Attribute Macros§
- main
#[rustango::main]— the Django-shape runserver entrypoint. Wraps#[tokio::main]and a defaulttracing_subscriberinitialisation (env-filter, falling back toinfo,sqlx=warn) so usermainfunctions are zero-boilerplate:
Derive Macros§
- Form
- Derive
rustango::forms::FormStruct(slice 8.4B). Generates aparse(&HashMap<String, String>) -> Result<Self, FormError>impl that walks every named field and: - Model
- Derive a
Modelimpl. See crate docs for the supported attributes. - Serializer
- Derive [
rustango::serializer::ModelSerializer] for a struct. - ViewSet
- Derive a
router(prefix, pool) -> axum::Routerassociated method on a marker struct, wiring the full CRUD ViewSet in one annotation.