pub struct ProjectionEngineHandler { /* private fields */ }Expand description
Adapter that lets a ProjectionEngine subscribe to an
EventBus. Wraps the engine in an
EventHandler that routes every relevant event through
ProjectionEngine::process. The engine stays accessible from outside
(e.g. for rebuild_all) via the same Arc.
Lives in arc-core because the adapter needs nothing app-specific —
any aggregate’s projector can be driven through it.
Implementations§
Source§impl ProjectionEngineHandler
impl ProjectionEngineHandler
pub fn new(engine: Arc<ProjectionEngine>) -> Self
Trait Implementations§
Source§impl EventHandler for ProjectionEngineHandler
impl EventHandler for ProjectionEngineHandler
Source§fn handles(&self) -> Vec<String>
fn handles(&self) -> Vec<String>
Returns the list of event types this handler is interested in. Read more
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a published event. Read more
Source§fn lane(&self) -> HandlerLane
fn lane(&self) -> HandlerLane
Selects the delivery lane for this handler.
Auto Trait Implementations§
impl !RefUnwindSafe for ProjectionEngineHandler
impl !UnwindSafe for ProjectionEngineHandler
impl Freeze for ProjectionEngineHandler
impl Send for ProjectionEngineHandler
impl Sync for ProjectionEngineHandler
impl Unpin for ProjectionEngineHandler
impl UnsafeUnpin for ProjectionEngineHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more