1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use async_trait::async_trait;

#[cfg(feature = "postgres")]
pub use pg_rebuilder::PgRebuilder;

use crate::Aggregate;

#[cfg(feature = "postgres")]
mod pg_rebuilder;

#[async_trait]
pub trait Rebuilder<A>
where
    A: Aggregate,
{
    type Executor;
    type Error: std::error::Error;

    async fn by_aggregate_id(&self, executor: Self::Executor) -> Result<(), Self::Error>;
    async fn all_at_once(&self, executor: Self::Executor) -> Result<(), Self::Error>;
}