| Crates.io | armature-cqrs |
| lib.rs | armature-cqrs |
| version | 0.1.0 |
| created_at | 2025-12-26 19:29:33.047392+00 |
| updated_at | 2025-12-26 19:29:33.047392+00 |
| description | CQRS pattern implementation for Armature applications |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006116 |
| size | 46,325 |
CQRS (Command Query Responsibility Segregation) for the Armature framework.
[dependencies]
armature-cqrs = "0.1"
use armature_cqrs::{Command, Query, Mediator};
#[derive(Command)]
struct CreateUser { name: String }
#[derive(Query)]
struct GetUser { id: String }
let mediator = Mediator::new()
.register_command::<CreateUser, _>(create_user_handler)
.register_query::<GetUser, _>(get_user_handler);
// Send command
mediator.send(CreateUser { name: "Alice".into() }).await?;
// Execute query
let user = mediator.query(GetUser { id: "123".into() }).await?;
MIT OR Apache-2.0