pub trait AggregateCreator {
type Command;
type Aggregate: AggregateRoot;
type Repository: Repository<Aggregate = Self::Aggregate>;
type Publisher: DomainEventPublisher<Event = <Self::Aggregate as AggregateRoot>::Event>;
type Output;
type Error;
// Required method
fn create<F>(
&mut self,
command: Self::Command,
callback: F,
) -> Result<Self::Output, Self::Error>
where F: for<'a> LifecycleCallback<'a, Self::Aggregate, Self::Repository, Self::Publisher, Output = Self::Output, Error = Self::Error>,
Self::Error: From<LifecycleOperationError<<Self::Repository as Repository>::Error>> + From<LifecycleOperationError<<Self::Publisher as DomainEventPublisher>::Error>> + From<LifecycleCompletionError>;
}Expand description
English:
Creates an aggregate from a command and runs the lifecycle callback before returning its output.
日本語:
コマンドから集約を作成し、ライフサイクルコールバックを実行してから出力を返します。
Required Associated Types§
type Command
type Aggregate: AggregateRoot
type Repository: Repository<Aggregate = Self::Aggregate>
type Publisher: DomainEventPublisher<Event = <Self::Aggregate as AggregateRoot>::Event>
type Output
type Error
Required Methods§
fn create<F>(
&mut self,
command: Self::Command,
callback: F,
) -> Result<Self::Output, Self::Error>where
F: for<'a> LifecycleCallback<'a, Self::Aggregate, Self::Repository, Self::Publisher, Output = Self::Output, Error = Self::Error>,
Self::Error: From<LifecycleOperationError<<Self::Repository as Repository>::Error>> + From<LifecycleOperationError<<Self::Publisher as DomainEventPublisher>::Error>> + From<LifecycleCompletionError>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".