Discern
Discern is a Rust library that implements the Command Query Responsibility Segregation (CQRS) pattern. It provides an easy-to-use framework for separating the write operations (commands) from the read operations (queries) in your Rust applications.
Features
- Command Handling: Easily define commands that change the state of your system.
- Query Handling: Define queries that retrieve data without modifying the state.
- Handler Registration: Register command and query handlers using convenient macros.
- Async Support: Fully asynchronous handling of commands and queries using
async_trait.
Installation
Add discern to your Cargo.toml:
[]
= "0.1.0"
Usage
Below is a simple example of how to use Discern to create a command bus that handles a CreateUserCommand:
use async_trait;
use Command;
use CommandBus;
use CommandHandler;
use command_bus;
;
async
Documentation
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.