pub trait Aggregate:
Default
+ Debug
+ Clone
+ Serialize
+ DeserializeOwned
+ MaybeSync
+ MaybeSend {
type Event: Event;
type Error: Error + MaybeSend + MaybeSync + 'static;
const TYPE: &'static str;
// Required methods
fn aggregate_id(&self) -> String;
fn with_aggregate_id(self, id: String) -> Self;
fn apply(&mut self, event: Self::Event) -> Result<(), Self::Error>;
fn error(status: StatusCode, details: &str) -> Self::Error;
}Required Associated Constants§
Required Associated Types§
Required Methods§
fn aggregate_id(&self) -> String
fn with_aggregate_id(self, id: String) -> Self
fn apply(&mut self, event: Self::Event) -> Result<(), Self::Error>
fn error(status: StatusCode, details: &str) -> Self::Error
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.