nitinol-projection 0.1.2

A library for Nitinol to project Events to Entity using nitinol-protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use async_trait::async_trait;
use nitinol_core::event::Event;
use std::fmt::Debug;

#[async_trait]
pub trait Projection<E: Event>: 'static + Sync + Send + Sized {
    type Rejection: Debug + 'static + Sync + Send;
    #[allow(unused_variables)]
    async fn first(event: E) -> Result<Self, Self::Rejection> {
        unimplemented!("starting point process is not implemented.");
    }
    async fn apply(&mut self, event: E) -> Result<(), Self::Rejection>;
}