| Crates.io | stately-derive |
| lib.rs | stately-derive |
| version | 0.5.0 |
| created_at | 2025-10-31 00:45:54.19814+00 |
| updated_at | 2026-01-05 21:01:09.459301+00 |
| description | Procedural macros for stately state management |
| homepage | https://github.com/georgeleepatterson/stately |
| repository | https://github.com/georgeleepatterson/stately |
| max_upload_size | |
| id | 1909166 |
| size | 84,993 |
Procedural macros for the Stately state management framework
This crate provides the procedural macros used by stately. You typically don't need to depend on this crate directly - it's re-exported by the main stately crate.
#[stately::entity]Derives the StateEntity trait for a struct, enabling it to be managed by Stately.
#[stately::entity]
#[derive(Clone, serde::Serialize, serde::Deserialize)]
pub struct Pipeline {
pub name: String,
}
Attributes:
#[stately(singleton)] - Mark as singleton entity#[stately(name_field = "field_name")] - Use different field for name#[stately(description_field = "field_name")] - Use field for description#[stately(description = "text")] - Static description#[stately::state]Generates application state with entity collections and CRUD operations.
#[stately::state]
pub struct AppState {
pipelines: Pipeline,
sources: SourceConfig,
}
API Generation:
#[stately::state(api = ["axum"])]
pub struct AppState {
pipelines: Pipeline,
}
Generates:
For complete documentation and examples, see the stately crate.
Licensed under the Apache License, Version 2.0. See LICENSE for details.